From 68333f3fd7356d7f8deab793de2f6ab4c95457ac Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 14:37:58 +0200 Subject: [PATCH 01/78] Nest.js server initialization --- .gitignore | 3 ++- nest-cli.json | 8 ++++++++ package.json | 7 +++++++ src/database/repositories/user.js | 3 ++- src/server/app.module.ts | 10 ++++++++++ src/server/main.ts | 8 ++++++++ src/server/prisma.service.ts | 16 ++++++++++++++++ src/server/tsconfig.json | 23 +++++++++++++++++++++++ src/server/user.controller.ts | 28 ++++++++++++++++++++++++++++ tsconfig.build.json | 4 ++++ tsconfig.build.tsbuildinfo | 1 + 11 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 nest-cli.json create mode 100644 src/server/app.module.ts create mode 100644 src/server/main.ts create mode 100644 src/server/prisma.service.ts create mode 100644 src/server/tsconfig.json create mode 100644 src/server/user.controller.ts create mode 100644 tsconfig.build.json create mode 100644 tsconfig.build.tsbuildinfo diff --git a/.gitignore b/.gitignore index 216f07f..ec8a1ac 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ src/api/.env src/api/node_modules src/api/package.json .env -src/database/prisma/migrations \ No newline at end of file +src/database/prisma/migrations +src/server/dist diff --git a/nest-cli.json b/nest-cli.json new file mode 100644 index 0000000..df37026 --- /dev/null +++ b/nest-cli.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "sourceRoot": "src/server", + "compilerOptions": { + "deleteOutDir": true + } + } \ No newline at end of file diff --git a/package.json b/package.json index f17b5e7..21a2205 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,9 @@ { "dependencies": { + "@nestjs/common": "^9.2.1", + "@nestjs/core": "^9.2.1", + "@nestjs/platform-express": "^9.2.1", + "@nestjs/schematics": "^9.0.4", "@prisma/client": "^4.8.1", "bcrypt": "^5.0.1", "chalk": "^5.0.0", @@ -11,6 +15,9 @@ "jsonwebtoken": "^9.0.0", "mysql": "^2.18.1", "puppeteer": "^13.0.1", + "source-map-support": "^0.5.21", + "tsconfig-paths": "4.1.1", + "typescript": "^4.9.4", "vue": "^2.6.14" }, "scripts": { diff --git a/src/database/repositories/user.js b/src/database/repositories/user.js index 5fd3135..a709e9b 100644 --- a/src/database/repositories/user.js +++ b/src/database/repositories/user.js @@ -71,4 +71,5 @@ class UserRepository { } } -module.exports = UserRepository; +exports.UserRepository = UserRepository; +// module.exports = UserRepository; diff --git a/src/server/app.module.ts b/src/server/app.module.ts new file mode 100644 index 0000000..4f49308 --- /dev/null +++ b/src/server/app.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { UserController } from './user.controller'; +import { PrismaService } from './prisma.service' + +@Module({ + imports: [], + controllers: [UserController], + providers: [PrismaService], +}) +export class AppModule {} diff --git a/src/server/main.ts b/src/server/main.ts new file mode 100644 index 0000000..13cad38 --- /dev/null +++ b/src/server/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { AppModule } from './app.module'; + +async function bootstrap() { + const app = await NestFactory.create(AppModule); + await app.listen(3000); +} +bootstrap(); diff --git a/src/server/prisma.service.ts b/src/server/prisma.service.ts new file mode 100644 index 0000000..a5dfac1 --- /dev/null +++ b/src/server/prisma.service.ts @@ -0,0 +1,16 @@ +import { Injectable, OnModuleInit, INestApplication } from '@nestjs/common' +import { PrismaClient } from '@prisma/client' + + +@Injectable() +export class PrismaService extends PrismaClient implements OnModuleInit { + async onModuleInit() { + await this.$connect() + } + + async enableShutdownHooks(app: INestApplication) { + this.$on('beforeExit', async () => { + await app.close() + }) + } +} \ No newline at end of file diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json new file mode 100644 index 0000000..ac4d2a8 --- /dev/null +++ b/src/server/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "allowJs": true, + "module": "commonjs", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es2017", + "sourceMap": true, + "outDir": "./dist", + "rootDir": "../../", + "baseUrl": "./", + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false + } +} diff --git a/src/server/user.controller.ts b/src/server/user.controller.ts new file mode 100644 index 0000000..d8a40f4 --- /dev/null +++ b/src/server/user.controller.ts @@ -0,0 +1,28 @@ +import { + Controller, + Get, + Param, + Post, + Body, + Put, + Delete, + Query, +} from '@nestjs/common'; +import { PrismaService } from './prisma.service'; +import { users as UserModel, Prisma } from '@prisma/client'; +import { UserRepository } from '../database/repositories/user.js'; + +const prisma = new PrismaService(); +const user = new UserRepository(prisma); + +@Controller() +export class UserController { + constructor(private readonly prismaService: PrismaService) {} + + @Get('users') + async getAllUsers(): Promise { + // just for the test + const userdata = await user.find('user'); + return userdata + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..996a8f7 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./src/server/tsconfig.json", + "exclude": ["node_modules", "src/server/dist", "**/*spec.ts"] +} diff --git a/tsconfig.build.tsbuildinfo b/tsconfig.build.tsbuildinfo new file mode 100644 index 0000000..2eb0d53 --- /dev/null +++ b/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.es2017.full.d.ts","./node_modules/reflect-metadata/index.d.ts","./node_modules/@nestjs/common/cache/cache.constants.d.ts","./node_modules/@nestjs/common/interfaces/abstract.interface.d.ts","./node_modules/@nestjs/common/interfaces/controllers/controller-metadata.interface.d.ts","./node_modules/@nestjs/common/interfaces/controllers/controller.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/arguments-host.interface.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/exception-filter.interface.d.ts","./node_modules/rxjs/dist/types/internal/subscription.d.ts","./node_modules/rxjs/dist/types/internal/subscriber.d.ts","./node_modules/rxjs/dist/types/internal/operator.d.ts","./node_modules/rxjs/dist/types/internal/observable.d.ts","./node_modules/rxjs/dist/types/internal/types.d.ts","./node_modules/rxjs/dist/types/internal/operators/audit.d.ts","./node_modules/rxjs/dist/types/internal/operators/audittime.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffer.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffercount.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffertime.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffertoggle.d.ts","./node_modules/rxjs/dist/types/internal/operators/bufferwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/catcherror.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatestall.d.ts","./node_modules/rxjs/dist/types/internal/operators/combineall.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatest.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatestwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/concat.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatall.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatmapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/connect.d.ts","./node_modules/rxjs/dist/types/internal/operators/count.d.ts","./node_modules/rxjs/dist/types/internal/operators/debounce.d.ts","./node_modules/rxjs/dist/types/internal/operators/debouncetime.d.ts","./node_modules/rxjs/dist/types/internal/operators/defaultifempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/delay.d.ts","./node_modules/rxjs/dist/types/internal/operators/delaywhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinct.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinctuntilchanged.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinctuntilkeychanged.d.ts","./node_modules/rxjs/dist/types/internal/operators/elementat.d.ts","./node_modules/rxjs/dist/types/internal/operators/endwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/every.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaustall.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaustmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/expand.d.ts","./node_modules/rxjs/dist/types/internal/operators/filter.d.ts","./node_modules/rxjs/dist/types/internal/operators/finalize.d.ts","./node_modules/rxjs/dist/types/internal/operators/find.d.ts","./node_modules/rxjs/dist/types/internal/operators/findindex.d.ts","./node_modules/rxjs/dist/types/internal/operators/first.d.ts","./node_modules/rxjs/dist/types/internal/subject.d.ts","./node_modules/rxjs/dist/types/internal/operators/groupby.d.ts","./node_modules/rxjs/dist/types/internal/operators/ignoreelements.d.ts","./node_modules/rxjs/dist/types/internal/operators/isempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/last.d.ts","./node_modules/rxjs/dist/types/internal/operators/map.d.ts","./node_modules/rxjs/dist/types/internal/operators/mapto.d.ts","./node_modules/rxjs/dist/types/internal/notification.d.ts","./node_modules/rxjs/dist/types/internal/operators/materialize.d.ts","./node_modules/rxjs/dist/types/internal/operators/max.d.ts","./node_modules/rxjs/dist/types/internal/operators/merge.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergeall.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergemap.d.ts","./node_modules/rxjs/dist/types/internal/operators/flatmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergemapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergescan.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergewith.d.ts","./node_modules/rxjs/dist/types/internal/operators/min.d.ts","./node_modules/rxjs/dist/types/internal/observable/connectableobservable.d.ts","./node_modules/rxjs/dist/types/internal/operators/multicast.d.ts","./node_modules/rxjs/dist/types/internal/operators/observeon.d.ts","./node_modules/rxjs/dist/types/internal/operators/onerrorresumenextwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts","./node_modules/rxjs/dist/types/internal/operators/partition.d.ts","./node_modules/rxjs/dist/types/internal/operators/pluck.d.ts","./node_modules/rxjs/dist/types/internal/operators/publish.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishbehavior.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishlast.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishreplay.d.ts","./node_modules/rxjs/dist/types/internal/operators/race.d.ts","./node_modules/rxjs/dist/types/internal/operators/racewith.d.ts","./node_modules/rxjs/dist/types/internal/operators/reduce.d.ts","./node_modules/rxjs/dist/types/internal/operators/repeat.d.ts","./node_modules/rxjs/dist/types/internal/operators/repeatwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/retry.d.ts","./node_modules/rxjs/dist/types/internal/operators/retrywhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/refcount.d.ts","./node_modules/rxjs/dist/types/internal/operators/sample.d.ts","./node_modules/rxjs/dist/types/internal/operators/sampletime.d.ts","./node_modules/rxjs/dist/types/internal/operators/scan.d.ts","./node_modules/rxjs/dist/types/internal/operators/sequenceequal.d.ts","./node_modules/rxjs/dist/types/internal/operators/share.d.ts","./node_modules/rxjs/dist/types/internal/operators/sharereplay.d.ts","./node_modules/rxjs/dist/types/internal/operators/single.d.ts","./node_modules/rxjs/dist/types/internal/operators/skip.d.ts","./node_modules/rxjs/dist/types/internal/operators/skiplast.d.ts","./node_modules/rxjs/dist/types/internal/operators/skipuntil.d.ts","./node_modules/rxjs/dist/types/internal/operators/skipwhile.d.ts","./node_modules/rxjs/dist/types/internal/operators/startwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/subscribeon.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchall.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchmapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchscan.d.ts","./node_modules/rxjs/dist/types/internal/operators/take.d.ts","./node_modules/rxjs/dist/types/internal/operators/takelast.d.ts","./node_modules/rxjs/dist/types/internal/operators/takeuntil.d.ts","./node_modules/rxjs/dist/types/internal/operators/takewhile.d.ts","./node_modules/rxjs/dist/types/internal/operators/tap.d.ts","./node_modules/rxjs/dist/types/internal/operators/throttle.d.ts","./node_modules/rxjs/dist/types/internal/operators/throttletime.d.ts","./node_modules/rxjs/dist/types/internal/operators/throwifempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeinterval.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeout.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeoutwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts","./node_modules/rxjs/dist/types/internal/operators/toarray.d.ts","./node_modules/rxjs/dist/types/internal/operators/window.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowcount.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowtime.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowtoggle.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/withlatestfrom.d.ts","./node_modules/rxjs/dist/types/internal/operators/zip.d.ts","./node_modules/rxjs/dist/types/internal/operators/zipall.d.ts","./node_modules/rxjs/dist/types/internal/operators/zipwith.d.ts","./node_modules/rxjs/dist/types/operators/index.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/action.d.ts","./node_modules/rxjs/dist/types/internal/scheduler.d.ts","./node_modules/rxjs/dist/types/internal/testing/testmessage.d.ts","./node_modules/rxjs/dist/types/internal/testing/subscriptionlog.d.ts","./node_modules/rxjs/dist/types/internal/testing/subscriptionloggable.d.ts","./node_modules/rxjs/dist/types/internal/testing/coldobservable.d.ts","./node_modules/rxjs/dist/types/internal/testing/hotobservable.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asyncscheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/timerhandle.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asyncaction.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/virtualtimescheduler.d.ts","./node_modules/rxjs/dist/types/internal/testing/testscheduler.d.ts","./node_modules/rxjs/dist/types/testing/index.d.ts","./node_modules/rxjs/dist/types/internal/symbol/observable.d.ts","./node_modules/rxjs/dist/types/internal/observable/dom/animationframes.d.ts","./node_modules/rxjs/dist/types/internal/behaviorsubject.d.ts","./node_modules/rxjs/dist/types/internal/replaysubject.d.ts","./node_modules/rxjs/dist/types/internal/asyncsubject.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asapscheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/async.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/queuescheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/animationframescheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/animationframe.d.ts","./node_modules/rxjs/dist/types/internal/util/identity.d.ts","./node_modules/rxjs/dist/types/internal/util/pipe.d.ts","./node_modules/rxjs/dist/types/internal/util/noop.d.ts","./node_modules/rxjs/dist/types/internal/util/isobservable.d.ts","./node_modules/rxjs/dist/types/internal/lastvaluefrom.d.ts","./node_modules/rxjs/dist/types/internal/firstvaluefrom.d.ts","./node_modules/rxjs/dist/types/internal/util/argumentoutofrangeerror.d.ts","./node_modules/rxjs/dist/types/internal/util/emptyerror.d.ts","./node_modules/rxjs/dist/types/internal/util/notfounderror.d.ts","./node_modules/rxjs/dist/types/internal/util/objectunsubscribederror.d.ts","./node_modules/rxjs/dist/types/internal/util/sequenceerror.d.ts","./node_modules/rxjs/dist/types/internal/util/unsubscriptionerror.d.ts","./node_modules/rxjs/dist/types/internal/observable/bindcallback.d.ts","./node_modules/rxjs/dist/types/internal/observable/bindnodecallback.d.ts","./node_modules/rxjs/dist/types/internal/anycatcher.d.ts","./node_modules/rxjs/dist/types/internal/observable/combinelatest.d.ts","./node_modules/rxjs/dist/types/internal/observable/concat.d.ts","./node_modules/rxjs/dist/types/internal/observable/connectable.d.ts","./node_modules/rxjs/dist/types/internal/observable/defer.d.ts","./node_modules/rxjs/dist/types/internal/observable/empty.d.ts","./node_modules/rxjs/dist/types/internal/observable/forkjoin.d.ts","./node_modules/rxjs/dist/types/internal/observable/from.d.ts","./node_modules/rxjs/dist/types/internal/observable/fromevent.d.ts","./node_modules/rxjs/dist/types/internal/observable/fromeventpattern.d.ts","./node_modules/rxjs/dist/types/internal/observable/generate.d.ts","./node_modules/rxjs/dist/types/internal/observable/iif.d.ts","./node_modules/rxjs/dist/types/internal/observable/interval.d.ts","./node_modules/rxjs/dist/types/internal/observable/merge.d.ts","./node_modules/rxjs/dist/types/internal/observable/never.d.ts","./node_modules/rxjs/dist/types/internal/observable/of.d.ts","./node_modules/rxjs/dist/types/internal/observable/onerrorresumenext.d.ts","./node_modules/rxjs/dist/types/internal/observable/pairs.d.ts","./node_modules/rxjs/dist/types/internal/observable/partition.d.ts","./node_modules/rxjs/dist/types/internal/observable/race.d.ts","./node_modules/rxjs/dist/types/internal/observable/range.d.ts","./node_modules/rxjs/dist/types/internal/observable/throwerror.d.ts","./node_modules/rxjs/dist/types/internal/observable/timer.d.ts","./node_modules/rxjs/dist/types/internal/observable/using.d.ts","./node_modules/rxjs/dist/types/internal/observable/zip.d.ts","./node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts","./node_modules/rxjs/dist/types/internal/config.d.ts","./node_modules/rxjs/dist/types/index.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/rpc-exception-filter.interface.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/ws-exception-filter.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validation-error.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/execution-context.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/can-activate.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/custom-route-param-factory.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/nest-interceptor.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/paramtype.interface.d.ts","./node_modules/@nestjs/common/interfaces/type.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/pipe-transform.interface.d.ts","./node_modules/@nestjs/common/enums/request-method.enum.d.ts","./node_modules/@nestjs/common/enums/http-status.enum.d.ts","./node_modules/@nestjs/common/enums/shutdown-signal.enum.d.ts","./node_modules/@nestjs/common/enums/version-type.enum.d.ts","./node_modules/@nestjs/common/enums/index.d.ts","./node_modules/@nestjs/common/interfaces/version-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-configuration.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-consumer.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-config-proxy.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/nest-middleware.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/index.d.ts","./node_modules/@nestjs/common/interfaces/global-prefix-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/before-application-shutdown.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-application-bootstrap.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-application-shutdown.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-destroy.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-init.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/index.d.ts","./node_modules/@nestjs/common/interfaces/external/cors-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/https-options.interface.d.ts","./node_modules/@nestjs/common/services/logger.service.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-context-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/http-server.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/message-event.interface.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@nestjs/common/interfaces/http/raw-body-request.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/index.d.ts","./node_modules/@nestjs/common/interfaces/injectable.interface.d.ts","./node_modules/@nestjs/common/interfaces/microservices/nest-hybrid-application-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/forward-reference.interface.d.ts","./node_modules/@nestjs/common/interfaces/scope-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/injection-token.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/optional-factory-dependency.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/provider.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/module-metadata.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/dynamic-module.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/introspection-result.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/nest-module.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/index.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-context.interface.d.ts","./node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-application.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-microservice.interface.d.ts","./node_modules/@nestjs/common/interfaces/index.d.ts","./node_modules/@nestjs/common/module-utils/constants.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/index.d.ts","./node_modules/@nestjs/common/module-utils/configurable-module.builder.d.ts","./node_modules/@nestjs/common/module-utils/index.d.ts","./node_modules/@nestjs/common/cache/interfaces/cache-manager.interface.d.ts","./node_modules/@nestjs/common/cache/interfaces/cache-module.interface.d.ts","./node_modules/@nestjs/common/cache/cache.module-definition.d.ts","./node_modules/@nestjs/common/cache/cache.module.d.ts","./node_modules/@nestjs/common/decorators/core/bind.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/catch.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/controller.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/dependencies.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/exception-filters.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/inject.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/injectable.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/optional.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/set-metadata.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-guards.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-interceptors.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-pipes.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/apply-decorators.d.ts","./node_modules/@nestjs/common/decorators/core/version.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/index.d.ts","./node_modules/@nestjs/common/decorators/modules/global.decorator.d.ts","./node_modules/@nestjs/common/decorators/modules/module.decorator.d.ts","./node_modules/@nestjs/common/decorators/modules/index.d.ts","./node_modules/@nestjs/common/decorators/http/request-mapping.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/route-params.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/http-code.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/create-route-param-metadata.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/render.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/header.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/redirect.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/sse.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/index.d.ts","./node_modules/@nestjs/common/decorators/index.d.ts","./node_modules/@nestjs/common/cache/decorators/cache-key.decorator.d.ts","./node_modules/@nestjs/common/cache/decorators/cache-ttl.decorator.d.ts","./node_modules/@nestjs/common/cache/decorators/index.d.ts","./node_modules/@nestjs/common/cache/interceptors/cache.interceptor.d.ts","./node_modules/@nestjs/common/cache/interceptors/index.d.ts","./node_modules/@nestjs/common/cache/interfaces/index.d.ts","./node_modules/@nestjs/common/cache/index.d.ts","./node_modules/@nestjs/common/exceptions/http.exception.d.ts","./node_modules/@nestjs/common/exceptions/bad-request.exception.d.ts","./node_modules/@nestjs/common/exceptions/unauthorized.exception.d.ts","./node_modules/@nestjs/common/exceptions/method-not-allowed.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-found.exception.d.ts","./node_modules/@nestjs/common/exceptions/forbidden.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-acceptable.exception.d.ts","./node_modules/@nestjs/common/exceptions/request-timeout.exception.d.ts","./node_modules/@nestjs/common/exceptions/conflict.exception.d.ts","./node_modules/@nestjs/common/exceptions/gone.exception.d.ts","./node_modules/@nestjs/common/exceptions/payload-too-large.exception.d.ts","./node_modules/@nestjs/common/exceptions/unsupported-media-type.exception.d.ts","./node_modules/@nestjs/common/exceptions/unprocessable-entity.exception.d.ts","./node_modules/@nestjs/common/exceptions/internal-server-error.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-implemented.exception.d.ts","./node_modules/@nestjs/common/exceptions/http-version-not-supported.exception.d.ts","./node_modules/@nestjs/common/exceptions/bad-gateway.exception.d.ts","./node_modules/@nestjs/common/exceptions/service-unavailable.exception.d.ts","./node_modules/@nestjs/common/exceptions/gateway-timeout.exception.d.ts","./node_modules/@nestjs/common/exceptions/im-a-teapot.exception.d.ts","./node_modules/@nestjs/common/exceptions/precondition-failed.exception.d.ts","./node_modules/@nestjs/common/exceptions/misdirected.exception.d.ts","./node_modules/@nestjs/common/exceptions/index.d.ts","./node_modules/@nestjs/common/file-stream/streamable-options.interface.d.ts","./node_modules/@nestjs/common/file-stream/streamable-file.d.ts","./node_modules/@nestjs/common/file-stream/index.d.ts","./node_modules/@nestjs/common/pipes/default-value.pipe.d.ts","./node_modules/@nestjs/common/interfaces/external/class-transform-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/transformer-package.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validator-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validator-package.interface.d.ts","./node_modules/@nestjs/common/utils/http-error-by-code.util.d.ts","./node_modules/@nestjs/common/pipes/validation.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-array.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-bool.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-int.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-float.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-enum.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-uuid.pipe.d.ts","./node_modules/@nestjs/common/pipes/file/file-validator.interface.d.ts","./node_modules/@nestjs/common/pipes/file/file-type.validator.d.ts","./node_modules/@nestjs/common/pipes/file/max-file-size.validator.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file-options.interface.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file.pipe.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.d.ts","./node_modules/@nestjs/common/pipes/file/index.d.ts","./node_modules/@nestjs/common/pipes/index.d.ts","./node_modules/@nestjs/common/serializer/class-serializer.interfaces.d.ts","./node_modules/@nestjs/common/serializer/class-serializer.interceptor.d.ts","./node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.d.ts","./node_modules/@nestjs/common/serializer/decorators/index.d.ts","./node_modules/@nestjs/common/serializer/index.d.ts","./node_modules/@nestjs/common/services/console-logger.service.d.ts","./node_modules/@nestjs/common/services/index.d.ts","./node_modules/@nestjs/common/utils/forward-ref.util.d.ts","./node_modules/@nestjs/common/utils/index.d.ts","./node_modules/@nestjs/common/index.d.ts","./src/server/app.service.ts","./src/server/app.controller.ts","./src/server/app.module.ts","./node_modules/@nestjs/core/adapters/http-adapter.d.ts","./node_modules/@nestjs/core/adapters/index.d.ts","./node_modules/@nestjs/core/injector/module-token-factory.d.ts","./node_modules/@nestjs/core/injector/compiler.d.ts","./node_modules/@nestjs/core/injector/modules-container.d.ts","./node_modules/@nestjs/core/injector/container.d.ts","./node_modules/@nestjs/core/injector/injector.d.ts","./node_modules/@nestjs/core/injector/instance-links-host.d.ts","./node_modules/@nestjs/core/injector/abstract-instance-resolver.d.ts","./node_modules/@nestjs/core/injector/module-ref.d.ts","./node_modules/@nestjs/core/injector/module.d.ts","./node_modules/@nestjs/core/injector/instance-wrapper.d.ts","./node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.d.ts","./node_modules/@nestjs/core/application-config.d.ts","./node_modules/@nestjs/core/constants.d.ts","./node_modules/@nestjs/core/discovery/discovery-module.d.ts","./node_modules/@nestjs/core/discovery/discovery-service.d.ts","./node_modules/@nestjs/core/discovery/index.d.ts","./node_modules/@nestjs/core/helpers/http-adapter-host.d.ts","./node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts","./node_modules/@nestjs/core/exceptions/index.d.ts","./node_modules/@nestjs/core/helpers/context-id-factory.d.ts","./node_modules/@nestjs/core/helpers/index.d.ts","./node_modules/@nestjs/core/injector/inquirer/inquirer-constants.d.ts","./node_modules/@nestjs/core/injector/inquirer/index.d.ts","./node_modules/@nestjs/core/metadata-scanner.d.ts","./node_modules/@nestjs/core/scanner.d.ts","./node_modules/@nestjs/core/injector/instance-loader.d.ts","./node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts","./node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.d.ts","./node_modules/@nestjs/core/injector/index.d.ts","./node_modules/@nestjs/core/middleware/routes-mapper.d.ts","./node_modules/@nestjs/core/middleware/builder.d.ts","./node_modules/@nestjs/core/middleware/index.d.ts","./node_modules/@nestjs/core/nest-application-context.d.ts","./node_modules/@nestjs/core/nest-application.d.ts","./node_modules/@nestjs/common/interfaces/microservices/nest-microservice-options.interface.d.ts","./node_modules/@nestjs/core/nest-factory.d.ts","./node_modules/@nestjs/core/repl/repl.d.ts","./node_modules/@nestjs/core/repl/index.d.ts","./node_modules/@nestjs/core/router/interfaces/routes.interface.d.ts","./node_modules/@nestjs/core/router/interfaces/index.d.ts","./node_modules/@nestjs/core/router/request/request-constants.d.ts","./node_modules/@nestjs/core/router/request/index.d.ts","./node_modules/@nestjs/core/router/router-module.d.ts","./node_modules/@nestjs/core/router/index.d.ts","./node_modules/@nestjs/core/services/reflector.service.d.ts","./node_modules/@nestjs/core/services/index.d.ts","./node_modules/@nestjs/core/index.d.ts","./src/server/main.ts","./node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"3284e33a45d6aa8324691ac5737d08695e35e99b5f69fdc9ef21b3c7e7fd8449","e89535c3ec439608bcd0f68af555d0e5ddf121c54abe69343549718bd7506b9c","622a984b60c294ffb2f9152cf1d4d12e91d2b733d820eec949cf54d63a3c1025","1a25c4d02a013b4690efa24ab48184a2c10b1906a379565ba558b2c3ba679a6d","ba6f9c5491bcf018dbbc813e1dd488beb26f876b825007ba76db485df341a8ee","75b57b109d774acca1e151df21cf5cb54c7a1df33a273f0457b9aee4ebd36fb9","fa3d0cd03fa17459d9ddd98b120b4bb084da39f0391cbdce480a6ef74be0cc7a","e3fd84e6470b7e0679c4073ee5ce971d324182486dde5a49b67cae29168b51d2","dd8331d0a5190a4735ce6c152e420230188c4966067a756673c36dd7ba72b10e","d6db3bf60a324f74ed9c1281acc1543734be70ac0ab9a8dc953a1d55f6906720",{"version":"d57e7ff5243e0dcd04cf2edf9ad9520af40edd6eba31c14c3f405f0c437fa379","affectsGlobalScope":true},"0f882d4ae58f431454030289154feb0132e1b00ca5c3197c6b749bd098aed73a","7ff7f4632a6e7b6872fb1843f3c0df495b49840eae2a23c6fbc943f863da8c29","1e352dc6863536f881c894f17c46b5040db7c9423a18957a8fbc001dfe579b78","a78590b0efcef281236e3234520c348d63be1d4561b63b20e6c3b6fc18b37dfb","4d59c6a10b6c79a0927c79efa89b3c9f71d174ec14ec2792076cfd2330d0cf8e","a496f51933422872de22729b7a0233589325a1a1707cccd05cd914098944a202","75b6663bc569724017997481b6b3774065c204b316cb4f5ad7df3b5162d2dce1","06a38095ad4368314366bc08f7cbc0fe274ef7321ec611005d0bdd9c6565e4d5","4599793db9aed9b84677f0ca1cf7ef3c69bb91cda4fe4329cbab778ca4d80a58","ad0028f96921778931fb8419d8de33b10908314fa99699de1702020f69235da1","ccd2a35321c0786bd3808042dc43b960cac13f2cc660ac37a0087e12bc97d2fc","df524ed01de4f19efb44bded628dbba9f840148be4b6cfe096e29d4b01589de3","2e3981b9cee48174ff85ae15019fd72933f7023a4ed05094740f7e6f7775623c","836ebdc3b9e4c006acc4f405b7e558e56d47830e05c40d991b1e27fe8bc91157","2cc6b617c6120ba64b5778ccd4b74c951adc3a3941bb6b39f47d48701c44af39","eca02b99615a8f1652e21399d832618e38bf166c0747c9247349bc901a2f7741","7f7d6d42e5780e86f5b860a6f95179fae06a368b3af28c1c4230397c47021a59","4740a7d11ab3b381be0f269f1903fb3ff226a2fba55a01756b2997e67cd853f2","863dbc4e77f0353e6f9d6bc0e2b4622d5c07ff6f099ff66cafd7924b2ff4dd3f","bf034a18ed7e2a058f9e48c4c2480a124138fbd3586a80c77736a9ec079d12a8","f88758992a0bf13d095520aacd4381fb456ff121fb9aa184e6eb0eecb26cfadc","c249e9ae33bfcad97deec3c73c9ed2656e112fbdf22deace0b39724be6a5dcf0","d8b45924965c0c4fc0b946c0b6d597aa8d5de9cdf5c727e3d39422d17efec438","c6f72b9a53b7819f056268c221d7eeb14c26e2582aa1547b0f6922d65bcfde72","feddabf6ab0eb191e721f0126f3db8688db97c77a1234968bde7a2d70c4ae513","a968efe0db090c2ed75ee8c77162534f7ffde3dfa9d9ee9f79c47784c43df96e","cde0568b836865a24f4ee5859462004a326dfb76d514e6f56c8e78feedebed58","7f5cb3a03588ed46d52a6c2138315d930cd6ffb5c2134247cd07bc23cbea0b5a","7797f4c91491dcb0f21fa318fd8a1014990d5a72f8a32de2af06eb4d4476a3b5","f39fb20b83c3f9853c13d4ac95533760979d3023c0a5affe2c0a62d91ab3afd8","e4fca08aed8afb32bb8643d7469810bc8681115fe398e56a028df9e73b2d867f","2622639d24718ddfccc33a9a6daf5a2dd94d540ca41e3da00fe365d2c3f25db3","078966067552650f44ca96c68eddbb8539f30ee48a9ab3f24abdcf0a4037b535","2cd6250c43dba360377481c98d48db6ab1532a7527339edb0deffddc28ba66b1","7a9d600990fbe263a23daebed9ba1bbc5761e45679a7e2b2774a42756ef077a2","66bc155515fbea8c31a4efccbbac44de7c037b01f3aa00b76312cf7252725d30","5703288ddbfc4f7845cdbf80c6af17c8cde2a228757479796c2378b1662fcd48","0dfd353f0c16dd5107a7e0713dc52d0a2538293b0a0eac6000a017f9c0a60b56","9cd683a4663ef4d9c6486f1b8a34c73bdbc344d69490931bfe2fbcada12ab35b","42f6a409bad5259ece69df25d2b8ace2ff2ade45fe6386ee45203bdd9329f971","d3b1a8b87a5e77d70056325e137a0e04d984b991546fdd3c1034ff4102d603c4","2eb162efd6dba5972b9f8f85141d900d09da4fba23864f287f98f9890a05e95f","3f878fb5be9ebe8bd0ac5c22515d42b8b72d3745ef7617e73e9b2548ccbdf54b","e9ed562b7599c8c8c01595891480a30f9945a93a46456d22ee67ebf346b7538a","e7bf975a98cecefe2e8902fb7da9314675ecdce553aea722aaec97327668e18b","3d36f93648518338c875d9f77a8eab52905365483dbb3afe43ed68f1b712b67c","4fa54df9184d291bd78b36f5063372042cd995460e906cb14014e40d1442a326","b4e32bd5e3b493e4ea6b5ec69a4c02aa1fdaa78e1df9a863bb07604de8f9d123","f6bd1aa152ca2b5064e06282ee3137842ae6825b6b09aa89a2ff063b976a56f3","bce2390bb3a76f8bf2ba4397c66db5277bf3e698ee614347e5eb79d7fc0942c6","fbdc8d7cc7daf4101bf567512c67fb990d8fe300e0ba7f213171192177f44aa0","298e0da6d858e39fc0c1eebfa4f5c8af487868c6f2e98c3ef800537d402fb5c3","3b6457fb3866562d279377f923cf3758c80ed7bfcc19414b72a24d0a98188e0c","4fb5d7efb3520b92c1b767ce18968057c5e70886d7fb3416c487231df9275af9","df2303a61eb57b2717d17123e82bc0f3fd60f6e4673cb5506192dfe23c9480bf","b104960f4c5f807535ab43282356b2fe29c5d14a02035c623ac2012be3d5f76c","a35ca245eb852b70b20300546443abb1fcbac6e5066e4baaa092af4ea614d9b5","55da140feab55f10a538a9879a97c4be3df4934cbd679665c91a7263a86095e1","1a39e51e3362aec7d4edec9b317ff83916fe0471f86ddf2d3ef3af5952e87d9e","4b3f36b96f129a8e125c91d41a05f711e73b3285f80bceb3a1aecb13c97c4502","852779920fc4220bc42ec6d3c9b6164e23ea9371a788531b48b4005fe0cb4392","6863aa26d38fb3c96d7b04547d677967d83ebe421a093e4dede6fd48ad23890d","515b97cede17d91c9669cc1c7fb7a8a5f0a5f2d8999f925a5f70b4ebea93723e","08e8e57241f874bdbf69ab2b65cb0ee18b4183d5c9452937da49b934fc679c4b","944af466f063d4bd090ab9d988c620b90a014e919d5f78963f6074a136ea225e","644addd4811636da491c9546654bc005ba8599f23df6d731d91eba86f3137fc2","a9249493114b181814728cbfeb7234738193a4169b654ec4705d48d7a4d25222","aad6f20d6eb01192ae02294361faa6e1f320d72447b56f433db853bbe80b15ca","876fbedec2f494eb6f834ce8636b07d581c657d205d81a3ba894eff0facc6b84","58527aa45f11c9b259a6a9d78b397f35020bfbb104f4d3bb177039b5c18146bd","91b8b61d45b5d22f3458a4ac82e03b464a0926bab795a920fe0eca805ec476eb","2744532f8fb960eb78497ac660db719f503a10c801f87131d26fd9cbef75dcef","6884287c54891ac19cfbe056f3ed29cab1732a00dec69bd3b140ce62c11783c6","223fdd3984d951378c7febea213b287ee04ee013f065a27905c3d75df85144c4","cb46657d3237f80742d5701ebcced8f6e5cf8938442354387d6c77d7048dfae6","3965c8ef8150ca688978430a13db460d29a50afc50c97315c723722b6f763369","661f322e45545a554e4ffc38db6c4068a66e1323baf66acb0d8a9fa28195a669","9d787416f04d0867e8a46c317056f6ad365e328074c73fa3a1612285fa24465d","ce978e20a6f26f606b535f0d6deb384ae6a73f8d0bd0dfca0925f5317cad1f25","f2d3567210ca4d559d8297d6c4402599c93e3bc7485054192d38db5e132fbc0a","50d22a2dfdbf2dda7b333edf980566feb3f61813695c8f3b52fc866c8d969404","bdb95f4b6e845ec1c0ae95eb448c55a68a2752473e1d2107348abe40421cc202","ea546a7ed9eaa71ba78d4d392509dadea4bafed283269dd6c4b09e7d8824e986","4ec0f2a141a9ae7d3557b8efe630ac2021bc3a9ac61238b59293f4cf2f196e82","b2db743c71652e03c52d51445af58d0af3316231faa92b66018b29c7ba975f6c","0863a5876c85fbaffbb8ec8aeda8b5042deb6932616139706d2b82cde9d3f7c7","12f8b72e3c3a333814f4fa87d5b9a7ef1ece703f3b7ec7919ad2ffb58c48c1db","ba9c46725e2a0bd9df59d3a1e801cc60f90db3ef7817131c53945dce2b8c0c56","281d373eeabf80c4851f8de991e6abe4d385c30379d80897bbc3df3dcac99cee","624c5dce95672d9dcca40d9d9d82ef855f5f902292f43aa265cc8fd963c6ce84","8a48d9c6184992d1c3ed5daa55f83d708c37582916926a5555a900608f804b60","605dd288c636cf9b5317fe76dec75d3c7fb855fdcd3ee8cb4fea7d7091ca6fb4","95addea67857d4e568a02e429b15458cec203876b2ea5f5ea18ccfeeb91b8ce0","b5a615b0ad865ffa562980a10bda162ac1744fd363b4edc2cfc664222071cbcf","bbccd721363897950a55ce09529503f25a69522e5c91a22679b66e941e5f8654","d3a1e70795c38d7851b6e4f3b441c5ffdae171d6e2576a2204b7d79059aeea66","d7b8d41887c5fccfe19802c4336d34348b752abf0d98839575699d71deff60be","063fe3004728b8516a4d799ee16f9a71801ba24e0443dd98638cef1bd4353a7c","9bceae6cc1126db61cec2f87102d3f28d5e44e5ec6fe25464b50f24ea562c23c","fab7912fc3ff45fce2f5d5febc9494c4d0a85d6c63fff68f21e4669c32eaacb9","f6c3fcb9d75d8aea778236fd9327ceb935b41865dbf3beac698be77e0ae9018d","b20bc124abd8ee572d0d756713ff987b116cdae908a6fcbc40e80d4b999f56b4","a599f3f450ad62c3fdc0c3fd25cddcc9332ffb44327087947d48914a8da81364","645dff895168aa82350c9aa60aa0b3621b84289fef043be842f45a9c6c0ac6e2","f068ff5b7fb3bdc5380e0c677e21de829bd25cdac63a9b083fdc220fcb225280","09d2fdca6ea6c135897a26976ad3c0db724adaf23ef4e38ad852b1d8efef1ae6","15de5b7739bf7e40213a200853bf78455ee5958af08eda786605a54a7f25ade6","aa31b69fc0094a66e771e189d387ffed138b53b211903f96ca3737792f69abdf","37862e711637ebd927907a82cbf0143ea30e95eb165df554926c43936b1d77a9","89e253db2c2cc9a510c521f14dd2b1aae4de2556ee5159ad8d118d3587e3a880","3d0a172cee184a0f4111a7bd7fbb8729af3f54b30c06a2677d85c20ea9c811ab","d6a07e5e8dee6dc63c7ecd9c21756babf097e1537fbc91ddfec17328a063f65d","6fdc88b1287c276b55b7f7c4c7b49587813c763eea9751ce0baf0a7e61cd5d89","6a02443704052768bd021f24783aa104b02ae4444e9b735317bf13c6b857a11e","37987b0fe9800cf25473c882ce07bccdab2763c5681c1a2d16816aead46aa8d1","c84c03c721154068e1a60d83e9e85819bd3ef70b824ac2edc498aa31c06e5781","1d6a5e3af9fdd51e9670a940abd27c59d57c1a77635f6888bec0281af3bde9fe","c96fb6a0c1e879f95634ab0ff439cbb6fff6227b26bbf0153bef9ed0aabba60d","db936079fe6396aad9bf7ad0479ffc9220cec808a26a745baebb5f9e2ef9dbc7","06bc0b9cc7bf0b92534f1517fe5adde1f23f60cc6cc5c59f8e1c65db48a40067","919a753b0cbb12ccc606c62e2d34884d75a48ba19b1dda497c72621b11dac088","2c27e33ee0bf722988da00abd582cc9b806ce3fd9153a864800a339ad13f3fcf","92d7b3a5aa5dc872e54cbad2a7094b3ea4f72c7901de1d07b4c334ff658297f0","7a52922b38e9686d5bdc6e75774929eec6688d26c1dfe4a03ddec77ede468e87","aa5efca2833d89b55248f1889a6433dab1b1f41768e9a75f8ce35f9bf56c5ec4","f3cb934699bea498259de69c44a4f93b461f079d72cddb041587afd9312efb6e","006855ddea8674d084173a768f88519dc154be94eba5e2120262a33709832b9b","17dd843a266f99ca4b3a1257538bd1cc69dc5c7f2f23c3891f0430615b8c9c1c","5430364886c721a30475253356162b6c27871718094cb3e69e2bcea71a17e533","1218398da7c8dc4add10bdb3aa2856aad54b123d847eaf574d1d694ac269bfb5","07886b8104556bcc9314b90cd2043f2286e54c1f6ba2ebbc953e1e43232e12be","b637cd92688a6cdf4f8f184ff529dc2bc7f15692828e2c0c66a60e6972f400c7","7061e83d6792897077bcac039fccf7325234004769f591c63a8cf8478bf551bb","51a74c09c3d3fc62fcfefed0a193c3d6388e3e0f8a574bb9d5c5b7cdaa32453a","277a358d61376fce7ac3392402909c96cf6a0a613146549fc0165ccff953e012","50614c808e099a1d4413786f3783d9eeaaa74b267f2c87fcf8a893287e91c301","f4cb6530f248e87cefa74ef623206fec805f6252f885f8e14ef3d1a5872cef2d","38c332caadd8391566552395d592076470a5e7423f70964620eabf05c02907cd","eb17b5bf1fc763a644c21d76572c0e41e351c3f6dfcde649428d5d829f7294d2","cb124162c87b29ff5121e3ee5bb29c782f101e0135d6c2644ab1b31d530a435e","406d6f5d3707c488362fb40d1c1f8a7b0a42b70554b427160185d93e430228f5","2e9776410c5bc290d9432a9215c67398a273e514a79b9e15f32ecddfde8a03be","313ff8df074b81d3e4f088ff3a3a06df3d9b0d0c7f55469ccc2ac887ecb6b867","c718475bca06806cc243e77777641cb67ba68f2c57321a4773ebb47760a3bcf2","96e6bf811343caab5112b68880905c5d20d9257054afac6c18e718a4c549ed27","a2793bc73ba63ca7d259cb0f0b61d0023820170d08a1f9715006c8042d060165","d5011b38165771fdf75a9a06d6d379a1fc7edd7eb695ebdc52319fb6e3c6d81f","88417fb19d339304e9616a38ea513251047c9e300c81f9467fc317df8a582e71","3e8e2d132f726dddbda57819f5391504e585cb3beab6b32203064e7e40618583","6e23627cd3f10418b5b2db102fdcf557b75f2837f266d88afac6b18f333bb1bc","866046dcea88f23d766a65487ee7870c4cf8285a4c75407c80a5c26ed250ef8d","019f4f1cbc781cc15c6173f8be5ef907405722194ab297127b3c3426e5368339","41f4413eac08210dfc1b1cdb5891ad08b05c79f5038bdf8c06e4aedaa85b943d","c79f1c8b51d8475dde8d2973f740f43ca34b1f0a95d93649cd76c1ee20abba19","35f0d2bd2c5c05c0cb19095bf5b7c44365b1c88efe6285370855b90417277a64","8264b129f4c4eb4799703f8e5ee2223a184d1cdbfc782158b1f40a88a4435a1f","527ddda6f8be1279f3294714534c49d6e90f238cea325519882ebf88d7ec5bd2","b23877792e8bd00271d0ec5d401b68e4228540a4316de3d9dfb697b955c161a4","35b2eb1de01633db90d41abe93730b29984856fcc840b4c2801bfd3761a2097b","95f0c9127b879c2fc7e31f8e09ff45bb4aae302e60f4b9ceaf4d9ee6bc51ec66","2a6b4655a6edce9e07c7d826848f72533c9991d40bc36e3f85558ad20e87ce2d","6e3d29fdc96ebbb2ac672d2dae710c689c1ea0d0e9469e0847616f3c38fd085f","d505055b8fadd42da235c85947911d8d198ad70c5f5775991e7821d4f89c90f5","8b5a5852099dca7d7e7a7cef6d681dc1586aafacdb963ca180fe5cabbfa3a24b","0d1aa3341d1ad2064adada71c5d01a2f572e4aac09410e5616d90894105a0eb9","52494ca5a884da3bf11b8165ab31429715f0970d9c6383240c5666f4bd713e01","162fafa2291749df2ab4516854aa781fcee1d9fca2ecd85fb48ae794c0700ce2","b4b9b51ee6f6309cda2e539245235a8caeca2b1d6bf12b5e5c162d17333c450f","d2ffe8356f060b88c1c5cf1fa874a4b779fb87fd1977084876e8be9eab6bf485","c76053984b39150d00ade365b096a8bc21a4a7f2ee9e0a926711b00f8e7bf701","956b510767e3d6f362ea5800510635197723737af5d19ae07ee987ea4a90bfa5","cd1a8ff61f5063d7e6e2094e25d35c90b499961b63911f2f4ae0ff5555c2b4d7","1cf09b5945779e9bc75c4dcd805fb149c28fc90da3335186ef620647a3c540e1","9cdc0b9a313090ec45b34ea1eb02fbace433f509e753634b043e9b83038261e6","c93474cff0088351a65d3cad24037874a26a5371a48528563e56efe31cb3d8bb","b4580df8ea7f62d7b06588001952bf69426e6b03cf3d2569f5f608e45f29ba08","de27f7bb9be9d8a2b4557ec6503b8a315f74d598ce9a0ab81b5ed5610e1a8e81","fe3c378dcefa7ed8b21bd6822f5d7838b1119836da75ae1e1fb485d27b8ffb62","7365bf3333d4277b6fe374ed055624e5ec080dbb919e2d78f1cb75a3f1a4b4f6","a5fbf3bc5c16ab5c84465ba7a043a4bee4c2b20bd3633d50d80118a3844edbaf","0923e4ac8c894ad507bd2daee0df66b699de88467201381ece011ba5a080e1ff","e4f6626f827ea509255647e1b6db82145a2eb1a6b46202655e7d9bb19145c33b","26e23972c40f378f0301d8d7025ea895557c2865a1a31c8ea9c3fff0dbc27075","d2ae223bdab8337f040858fbf1ff3b6544ace8f679cc18a73f6d1c8d87113a94","795a08ae4e193f345073b49f68826ab6a9b280400b440906e4ec5c237ae777e6","8153df63cf65122809db17128e5918f59d6bb43a371b5218f4430c4585f64085","a8150bc382dd12ce58e00764d2366e1d59a590288ee3123af8a4a2cb4ef7f9df","5adfaf2f9f33957264ad199a186456a4676b2724ed700fc313ff945d03372169","d5c41a741cd408c34cb91f84468f70e9bda3dfeabf33251a61039b3cdb8b22d8","6e87c0c1cf06fe7dd6e545d72edefd61d86b4f13d2f9d34140e8168af94a7b7d","cbaf4a4aa8a8c02aa681c5870d5c69127974de29b7e01df570edec391a417959","b8d9df5c49858df86ffa6c497f1840528963c14ca0dea7684e813b008fe797b3","340a45cd77b41d8a6deda248167fa23d3dc67ec798d411bd282f7b3d555b1695","b1f8c85b27619ccfae9064e433b3b32a11d93d54de5a1afdaeca23c8b30e38a5","0ed6417b905cddb85f98281cb3b5b137d393955521993d9ce069d5e2d6b26ee8","f9ceab53f0d273ccaa68ef125974305dc26fe856af9a5be401ca72d0f78659d4","99d99a765426accf8133737843fb024a154dc6545fc0ffbba968a7c0b848959d","c782c5fd5fa5491c827ecade05c3af3351201dd1c7e77e06711c8029b7a9ee4d","883d2104e448bb351c49dd9689a7e8117b480b614b2622732655cef03021bf6d","8a10bdd9317aa91b37ee4b6dbd40529d0cd16353f04cf7c27b29c5604a28e8c3","09a7e04beb0547c43270b327c067c85a4e2154372417390731dfe092c4350998","eee530aaa93e9ec362e3941ee8355e2d073c7b21d88c2af4713e3d701dab8fef","ebf6ea6f412af15674333149f7f6561c0de9e36a4d4b350daccf6c5acbbf9fa3","1d6cc6dc76a777be3856c8892addb58d60b8957730951f9ab8b721e4f7fdf7e9","7a0e4cd92545ad03910fd019ae9838718643bd4dde39881c745f236914901dfa","c99ebd20316217e349004ee1a0bc74d32d041fb6864093f10f31984c737b8cad","6f622e7f054f5ab86258362ac0a64a2d6a27f1e88732d6f5f052f422e08a70e7","d62d2ef93ceeb41cf9dfab25989a1e5f9ca5160741aac7f1453c69a6c14c69be","1491e80d72873fc586605283f2d9056ee59b166333a769e64378240df130d1c9","c32c073d389cfaa3b3e562423e16c2e6d26b8edebbb7d73ccffff4aa66f2171d","eca72bf229eecadb63e758613c62fab13815879053539a22477d83a48a21cd73","633db46fd1765736409a4767bfc670861468dde60dbb9a501fba4c1b72f8644d","1f9cc8013b709369d82a9f19813cd09cd478481553a0e8262b3b7f28ab52b0b2","a314a39426700ba2b5a76c01bab321bbe79cfef898dae996e930b017fc2b0af9","7f2c10fc5de794bf7ddad2ff13b46e2b7f89ced296c1c372c5fdb94fc759d20d","6ea6e80bf94a93e4841d57878bba521822ca5e2ec7cbb626196a8efc2766eb79","8776e64e6165838ac152fa949456732755b0976d1867ae5534ce248f0ccd7f41","fdaf3475e11582e137bd84fa19f6bdbf23623f79cecc48a4037e8fa5756ba340","5c4c5b49bbb01828402bb04af1d71673b18852c11b7e95bfd5cf4c3d80d352c8","7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"ca72190df0eb9b09d4b600821c8c7b6c9747b75a1c700c4d57dc0bb72abc074c","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"bb65c6267c5d6676be61acbf6604cf0a4555ac4b505df58ac15c831fcbff4e3e","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","dab86d9604fe40854ef3c0a6f9e8948873dc3509213418e5e457f410fd11200f","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"d076fede3cb042e7b13fc29442aaa03a57806bc51e2b26a67a01fbc66a7c0c12","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","fd93cee2621ff42dabe57b7be402783fd1aa69ece755bcba1e0290547ae60513","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","223c37f62ce09a3d99e77498acdee7b2705a4ae14552fbdb4093600cd9164f3f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"4c50342e1b65d3bee2ed4ab18f84842d5724ad11083bd666d8705dc7a6079d80","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"8dbe725f8d237e70310977afcfa011629804d101ebaa0266cafda6b61ad72236","6b8861483f8d90261908256836f1b8951d1f4ac9a2a965e920fb18603c8d1d0a","72afd0094250e7f765576466170a299d0959a4799dbf28eb56ba70ca4772a8b4","44ec212fbf43580505de3d6054376ced252c534ced872c53698047387213efb9","4880c2a2caa941aff7f91f51948ebfb10f15283ff0b163f8ea2a74499add61aa","19c3760af3cbc9da99d5b7763b9e33aaf8d018bc2ed843287b7ff4343adf4634","9d1e38aeb76084848d2fcd39b458ec88246de028c0f3f448b304b15d764b23d2","b1048a866abac5d678376310d28fd258fd4d663942ac915a5fa90e585cf598f8","c9c6eed8faed23fc697b79d421ac443594a3458ae2a60150083ee1e860171971","9cc2a5c3e3c4be782a2300d356b94286764166acf2a6eedc83c6f7a53c0397f7","9ddf8e9069327faa75d20135cab675779844f66590249769c3d35dd2a38c2ba9","d7c30f0abfe9e197e376b016086cf66b2ffb84015139963f37301ed0da9d3d0d","ff75bba0148f07775bcb54bf4823421ed4ebdb751b3bf79cc003bd22e49d7d73","69196fa55fab9cd52c4eecba6051902bd5adff63ecf65e0546cb484b5a279fb1","35a9867207c488061fb4f6fe4715802fbc164b4400018d2fa0149ad02db9a61c","91bf47a209ad0eae090023c3ebc1165a491cf9758799368ffcbee8dbe7448f33","b75aa590b103f8491e1c943f9bc4989df55323d7e68fba393d3de11f4aae6bb8","4894a2c13e65af4fea49a2013e9123fe767a26ae51adb156e1a48dffba1e82f7","fc2a131847515b3dff2f0e835633d9a00a9d03ed59e690e27eec85b7b0522f92","90433c678bc26751eb7a5d54a2bb0a14be6f5717f69abb5f7a04afc75dce15a4","55ae9554811525f24818e19bdc8779fa99df434be7c03e5fc47fa441315f0226","7210df9e28cc71105d8938508a8bf99e7bf7df1f18548d774d7c2accbfb3332e","b842238362d1d1879242576ea63d436daa335613559ef0aff586825638d2d47a","e7bde95a05a0564ee1450bc9a53797b0ac7944bf24d87d6f645baca3aa60df48","62e68ce120914431a7d34232d3eca643a7ddd67584387936a5202ae1c4dd9a1b","e6b74c07c5a4e65b27f5a419467e021f61d45255d625bacffe502bd226ffc41d","e1cb8168c7e0bd4857a66558fe7fe6c66d08432a0a943c51bacdac83773d5745","70e929fee0f98d969cd4247583b4f70fe912787be58e21f6e9123b4afdaeb8f7","cd0eeda77ab149135d817ac1e1cd1e88f73bf37fe5a652b5c14e124e676201cf","cbc15ecf15b73c132087c185178ba51b7a786ff4a51b6f52a50b01aeb3d48353","8ca60a0840c741e66d4421defe62d44226167a4750fcfa080f760a8f9487fd1d","6d8dedbec739bc79642c1e96e9bfc0b83b25b104a0486aebf016fc7b85b39f48","cd0565ace87a2d7802bf4c20ea23a997c54e598b9eb89f9c75e69478c1f7a0b4","c18f4f72a68275b7602e5968b862cb9b7b76ea4a1ac1b3e622f99e0b672569e8","0fdb1ed509382bd388896d3770655b0cda8c80c36f8c54b3899992f7a3a8665c","d97b96b6ecd4ee03f9f1170722c825ef778430a6a0d7aab03b8929012bf773cd","f55fc3e536ab193aaabb9b6ded5f93181f81294ee65fe3199c9f4415f0f1e53c","ec8053ec564993a885ba2e2c31408369270a190a332a29fac7a825bb7e60b37c","542ecc66e4fcc33f46695ae22b1d14c075054a78c019915d556636be642465af","476b5c25e85b94e15d761bb9503f55fb11e81167df451f187f5080fca825273b","72636f59b635c378dc9ea5246b9b3517b1214e340e468e54cb80126353053b2e","ebb79f267a3bf2de5f8edc1995c5d31777b539935fab8b7d863e8efb06c8e9ea","ada033e6a4c7f4e147e6d76bb881069dc66750619f8cc2472d65beeec1100145","52ff5e1ea35c54428b46c75fd14f87b7a7158a8f4a1ecfc4a9b996a03185c738","605d29d619180fbec287d1701e8b1f51f2d16747ec308d20aba3e9a0dac43a0f","67c19848b442d77c767414084fc571ce118b08301c4ddff904889d318f3a3363","c704ff0e0cb86d1b791767a88af21dadfee259180720a14c12baee668d0eb8fb","195c50e15d5b3ea034e01fbdca6f8ad4b35ad47463805bb0360bdffd6fce3009","da665f00b6877ae4adb39cd548257f487a76e3d99e006a702a4f38b4b39431cb","0d276d377a0bf0f35e8d7a5b871922ebfa6aff1757d1bbe27a7982b15ce78516","9cbb45413acfdf0cc384d884de88c3f951319004450c88a2bcdad62a11bd21d9","d7a4309673b06223537bc9544b1a5fe9425628e1c8ab5605f3c5ebc27ecb8074","ced87f58b05e2b07e314754f0a7ab17e2df9c37ee2d429948024b2c6418d6c9f","3eadfd083d40777b403f4f4eecfa40f93876f2a01779157cc114b2565a7afb51","3ac0b94ba8f884f63d38450ce9e29ecd59ff00805ffdd609193d7532b8605459","a3684ea9719122f9477902acd08cd363a6f3cff6d493df89d4dc12fa58204e27","2828dabf17a6507d39ebcc58fef847e111dcf2d51b8e4ff0d32732c72be032b3","c0c46113b4cd5ec9e7cf56e6dbfb3930ef6cbba914c0883eeced396988ae8320","118ea3f4e7b9c12e92551be0766706f57a411b4f18a1b4762cfde3cd6d4f0a96","473bf3574a48185f71b70fe839fb1a340a176d80ea7f50dee489c2dc8e81613f","2b14b50de7e32a9882511d1b06be4eb036303bc72ce4a10f93a224382731500d","eeb24fa259f000f6b51a1fe89123f55de081eb2a0ef8d8f847afd67af49cfb68","91d8f3c1c3ae5efb8564ec7cb1f8ac8bf5714eb94078fb50a761ab811963e324","e21bb2cfbcdd8ce7eebb72422f3660806724f2b16cd6ce126d527511abb3a379","c04146836a55ea071b435298335e47f569db0e4d3ae420e35c83e448f944192f","31f71fe23daabea143fc8bd21dae0d5908227180fcda38ad3674df70351f9761","517168a194de5ffaf307e9f8d9eea05952997e795c2f21f8fbc37c64bc8c3872","6305acbe492b9882ec940f8f0c8e5d1e1395258852f99328efcb1cf1683ca817","7619b1f6087a4e9336b2c42bd784b05aa4a2204a364b60171e5a628f817a381e","15be9120572c9fbcd3c267bd93b4140354514c9e70734e6fcca65ff4a246f83a","412482ab85893cec1d6f26231359474d1f59f6339e2743c08da1b05fc1d12767","858e2315e58af0d28fcd7f141a2505aba6a76fd10378ba0ad169b0336fee33fc","02da6c1b34f4ae2120d70cf5f9268bf1aedf62e55529d34f5974f5a93655ce38","3ecf179ef1cc28f7f9b46c8d2e496d50b542c176e94ed0147bab147b4a961cd6","b145da03ce7e174af5ced2cbbd16e96d3d5c2212f9a90d3657b63a5650a73b7f","c7aadab66a2bc90eeb0ab145ca4daebcbc038e24359263de3b40e7b1c7affba6","99518dc06286877a7b716e0f22c1a72d3c62be42701324b49f27bcc03573efff","f4575fd196a7e33c7be9773a71bcc5fbe7182a2152be909f6b8e8e7ba2438f06","05cba5acd77a4384389b9c62739104b5a1693efd66e6abac6c5ffc53280ae777","acacda82ebd929fe2fe9e31a37f193fc8498a7393a1c31dc5ceb656e2b45b708","1b13e7c5c58ab894fe65b099b6d19bb8afae6d04252db1bf55fe6ba95a0af954","4355d326c3129e5853b56267903f294ad03e34cc28b75f96b80734882dedac80","37139a8d45342c05b6a5aa1698a2e8e882d6dca5fb9a77aa91f05ac04e92e70b","e37191297f1234d3ae54edbf174489f9a3091a05fe959724db36f8e58d21fb17","3fca8fb3aab1bc7abb9b1420f517e9012fdddcbe18803bea2dd48fad6c45e92e","d0b0779e0cac4809a9a3c764ba3bd68314de758765a8e3b9291fe1671bfeb8a1","d2116b5f989aa68e585ae261b9d6d836be6ed1be0b55b47336d9f3db34674e86","d79a227dd654be16d8006eac8b67212679d1df494dfe6da22ea0bd34a13e010c","b9c89b4a2435c171e0a9a56668f510a376cb7991eaecef08b619e6d484841735","b85baa660305c65d45f97f5b227b1505a8023955f1bf27da178232e7be99cc12","d5dd266b6f5c9c24f6b4001e172615626a51e350b3267b4af3970e4fb2c57fab","89049878a456b5e0870bb50289ea8ece28a2abd0255301a261fa8ab6a3e9a07d","a464510505f31a356e9833963d89ce39f37a098715fc2863e533255af4410525","ebbe6765a836bfa7f03181bc433c8984ca29626270ca1e240c009851222cb8a7","ac10457b51ee4a3173b7165c87c795eadd094e024f1d9f0b6f0c131126e3d903","b2f2311d7085a1feec3f6a85d7cc8bdaf1d976de1874c1f92940ad8ce6a34d39","954523d1f4856180cbf79b35bd754e14d3b2aea06c7efd71b254c745976086e9","4ee1e0fea72cd6a832c65af93b62fbf39b009e3711384bb371b48c9abba66781","d35fb65da678a4971822249d657f564ff6bdb6618428642235c4858ebafb2379","b27a613e49e00740db23e2e267b8e44e51ee85a448e787b7fa7c7a7be7316104","4d54136f3080a92f0b031115719321fa25bd855582c30f7f6b6e78969ffe7ec5","6c7554f14f08d3264e220f6ac82cf00e3b6a3bd15ec676bd97bf0e06da79e18d","a2506732a96c864f9336a4fc0403f7f4f3831cfe1db4a40ddf95866dbe2d28ef","8aa451aa2c6e762f359e6fae74e2903f6e3304b1a5ae19c1da548128ddf25add","2e756f5c2e33e9b28aebe174d147a19b46f2364027050acb8c8c2f83e005b2ec","434ea45c930ac3accf5951ac80af2da02a3e0945d33f1e59dbd3a50498cb519b","dc5f64a739746e51c220dceef9b4de820a1daa2dea3254d63bba9988ddcb500b","ab555ebf13e4f021233b5dbd6876eb2a4514aa651693ba9fa38d1e7e7df3b841","6b3233127e08357fda5142130d43a222ed0dac32861ac6c72f8288c0c79cf749","0d4dab75055c9279cb1dcb693cf8568bd724e4f653fd95a3a82ad2e267c4dda6","e4b29bf9f77857ac881ae8eb16d685ecc53e0a996f20d4ff762a6f2974474d90","df6c83e574308f6540c19e3409370482a7d8f448d56c65790b4ac0ab6f6fedd8","32f19b665839b1382b21afc41917cda47a56e744cd3df9986b13a72746d1c522","405fa7000efd4f0317eb31fa76ed40bad16be48ef2efc88b53bbe439fae74aaa","3e5a089877b3647b42c6f8d8284ff26e57fd3d94f1b1736080079796b994a89e","fde8122ba963e8f7ef9da2a35029632dc8637e9740c9d8cc9745d94ca42e6762","5a44788293f9165116c9c183be66cefef0dc5d718782a04847de53bf664f3cc1","afd653ae63ce07075b018ba5ce8f4e977b6055c81cc65998410b904b94003c0a","e113cc2ab6f65586cbba1618aab57af8f1e1fbe0ab9c3d339f1b348f6fe8f63c","9f96b9fd0362a7bfe6a3aa70baa883c47ae167469c904782c99ccc942f62f0dc","5df9a68835c1e020625127d8c951c90808d319c811fc3a780d24f64053192ea4","71807b208e5f15feffb3ff530bec5b46b1217af0d8cc96dde00d549353bcb864","67f7637f370ee8c18fe060c901e071db2c4368de90a5c58cf1f959d12b0c2f7e","eaf8514ce110fa428a93a27408df4d06d133dbd9ed0a775c315ddfdd507853a9","260f889b9e2b69f77be1155348eb345166aec664b3efff6720053c6844a41f28","319f8e45e370ba3d33f0887e3046096714959d3764fc68b444885cfdb9c101dd","e9cba458ea179833bba7b180c10e7293b4986d2f66a7bd99c13f243d91bab3d4","8b0b6a4c032a56d5651f7dd02ba3f05fbfe4131c4095093633cda3cae0991972","27484cb3aa328bc5d0957fcb34df68a5db1be280af510d9ed3a282b1a0a93b38","6c2b8c78eb1476ad2668898923fda9c3e67b295b9a6dc7a7312ead2582a76883","d8fb0821bcebbcc5ef87655a6442e8909313eb0bd7960f696b10cdb31576fdaa","1053398d8fd9b1a45170b5cca30bd54abe7ec7061ef2929c4da9feaa71737930","83f7f1890b6a202865b1014b5e72b2115f522773304d61569396be144bbee2fc","8949f85fb38104d50011076ac359186889d6e18e230b0cf8256230e802e8c4ed","fe4613c6c0d23edc04cd8585bdd86bc7337dc6265fb52037d11ca19eeb5e5aaf","667f0c535a93ce1f70d528b57a5c4bf2af8f60559795f39399c8958ede1b66a7","0f02f73e940e993a73103717e21e1d74166b83093bcb299d5e2b5c8bdc684c9b","31a335eb49c1ea1b0d8ded51d2dee99d96b45e67f581638b2bce9cd121a2dcdc","c86ad86cc7a3ec3794deab9b943a823d9aaf09b846bb581a06bf263117e8d6d9","cfe88132f67aa055a3f49d59b01585fa8d890f5a66a0a13bb71973d57573eee7","f23601713615719b1a1394deae884fb9f507de819a086d5a019c63793da9efc6","50fd11b764194f06977c162c37e5a70bcf0d3579bf82dd4de4eee3ac68d0f82f","ad5ad568f2f537a43dcc1588b2379f9dc79539ae36b8821b13a5d03625211eb2","99579aa074ed298e7a3d6a47e68f0cd099e92411212d5081ce88344a5b1b528d","d2d58166965f631fa203f405f3713b0f86f1f8b80755e9daea43057a25311e16","ce7dbf31739cc7bca35ca50e4f0cbd75cd31fd6c05c66841f8748e225dc73aaf","942ab34f62ac3f3d20014615b6442b6dc51815e30a878ebc390dd70e0dec63bf","a861cceeb708d23beebcf7f3235dcdd1a5a7d1655afd6ba49dbc0d45f5370469","0256d60785ede7860b5262f504f139aa68f74db44ba9f03807b752864580772c","396c1e5a39706999ec8cc582916e05fcb4f901631d2c192c1292e95089a494d9","89df75d28f34fc698fe261f9489125b4e5828fbd62d863bbe93373d3ed995056","7cb9b6d5c1e3508fbc81e7bbab314eac54715f9326ac72fd0eb65f17a4393d50","eefa4f00b4a4c150786e5ed866999b44687388e94a99f0b67a78b59c5b2303fd","be75c12a8d61aaadb9e33e0d7d0e7b2f3bee9a3ac618d04367e0b7c2aea3f86d","e6223b7263dd7a49f4691bf8df2b1e69f764fb46972937e6f9b28538d050b1ba","bf6599adc97713bc0eefb924accc7cb92c4415718650166fcf6157a1ef024f01","1db014db736a09668e0c0576585174dbcfd6471bb5e2d79f151a241e0d18d66b","98fca44eb9a677e5bd6eafaa95eeefbe719c3d520edc819c5d8186dcd7971163","56a2cc03b33542972ed37df7153319540238d34a3a688a004cffcb90c84b3138","82d3e00d56a71fc169f3cf9ec5f5ffcc92f6c0e67d4dfc130dafe9f1886d5515","9a388a54fbab04eef88430f5775cc48c1069d14e852d6fdb10cc966a9c3cd8e8","7007c800fbb767a1137e011d7d8fe0847cbd1a9e99bbe3528db955e32a32d6c1","e3d221660c0b79a9a3ba1111b3dfbb1136c0b52d7609b0054d3ce09ce711a3e6","892adfd3427fa4ed24bede88e8e46e4cb67e53e794365023fd473f3be796981d","b4f1cc43cdf2f75f62ea43ab32ac29e26649920906712d9605cef4849f48065b","9fac6ebf3c60ced53dd21def30a679ec225fc3ff4b8d66b86326c285a4eebb5a","992fda06eebba15d37625007500bef5b3fdd1c5e2f5a334064efeb1604c7bce3","07bc8a3551e39e70c38e7293b1a09916867d728043e352b119f951742cb91624","e47adc2176f43c617c0ab47f2d9b2bb1706d9e0669bf349a30c3fe09ddd63261","7fec79dfd7319fec7456b1b53134edb54c411ba493a0aef350eee75a4f223eeb","189c489705bb96a308dcde9b3336011d08bfbca568bcaf5d5d55c05468e9de7a","98f4b1074567341764b580bf14c5aabe82a4390d11553780814f7e932970a6f7","abdc0a8843b28c3cafbefb90079690b17b7b4e2a9c9bbf2cd8762e11a3958034","2e252235037a2cd8feebfbf74aa460f783e5d423895d13f29a934d7655a1f8be","f3e04e6c6db44b9ad05a0b7c89e914b08eee05f2050968b761ed98735d42cd62","e25d9bd8f80b6ffbcc8826ed1b407e747e4fbe346c5bab62cbe5837da4eeb189","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":1,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./src/server/dist","removeComments":true,"rootDir":"./src/src/server","skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":false,"target":4},"fileIdsList":[[324],[324,357,359],[324,350,359,360],[324,389],[246,324,389],[324,390,391],[48,324,361,392,394,395],[242,324,350],[324,393],[324,350,357,358],[324,358,359],[324,350],[258,324,337],[324,453],[324,362,363,364,365,366,367,368,369,370,371,372,373,374,375],[251,324,337],[258,324],[248,324,350,453],[324,380,381,382,383,384,385,386,387],[253,324],[324,350,453],[324,376,379,388],[324,377,378],[324,341],[253,254,255,256,324],[324,397],[324,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418],[324,421],[312,324,331,420],[47,257,324,350,357,389,396,419,422,443,448,450,452],[52,324],[52,242,324],[251,324,424],[245,324,426],[242,246,324],[52,324,350],[250,251,324],[263,324],[265,266,267,268,269,324],[257,258,271,275,324],[276,277,324,332],[324,331],[49,50,51,52,53,243,244,245,246,247,248,249,250,251,252,258,263,264,270,275,324,333,334,335,337,345,346,347,348,349],[274,324],[259,260,261,262,324],[251,259,260,324],[251,257,258,324],[251,261,324],[251,324,341],[324,336,338,339,340,341,342,343,344],[49,251,324],[324,337],[49,251,324,336,340,342],[260,324],[324,338],[251,324,337,338,339],[273,324],[251,255,273,324,345],[271,272,274,324],[247,249,258,264,271,276,324,346,347,350],[53,247,249,252,324,346,347],[256,324],[242,324],[273,324,350,351,355],[324,355,356],[324,350,351],[324,350,351,352],[324,352,353],[324,352,353,354],[252,324],[324,436],[324,436,437,438,439,440,441],[324,428,436],[324,436,437,438,439,440],[252,324,436,439],[324,423,429,430,431,432,433,434,435,442],[252,324,350,429],[252,324,428],[252,324,428,453],[245,251,252,324,424,425,426,427,428],[242,324,350,424,425,444],[324,350,424],[324,446],[324,389,444],[324,444,445,447],[273,324,449],[324,336],[257,324,350],[324,451],[271,275,324,350,453],[324,457],[324,350,453,468,469],[324,461,467,468],[324,472,473],[324,453,458,475],[324,476],[324,468],[324,475,478],[47,324,458,470,471,474,477,479,482,487,490,491,492,494,496,502,504],[324,350,453,463,464,467,468],[324,350,459],[251,324,334,453,459,460,461,467,468,470,505],[324,461,462,466,468,481,486],[324,350,453,467,468],[324,480],[324,462,467,468],[324,453,462,463,467],[324,350,453,467],[324,453,460,461,466,483,484,485],[324,350,453,462,463,464,465,467,468],[251,324,453],[324,350,462,466,468],[324,467],[324,334],[263,324,350,488],[324,489],[324,350,462],[271,324,350,453,458,462,470,491],[274,275,324,453,457,493],[324,495],[311,324,331,453],[324,498,500,501],[324,497],[324,499],[324,453,461,467,498],[51,251,324,334,350,453,462,467,470,482],[324,503],[278,324],[281,324],[282,287,315,324],[283,294,295,302,312,323,324],[283,284,294,302,324],[285,324],[286,287,295,303,324],[287,312,320,324],[288,290,294,302,324],[289,324],[290,291,324],[294,324],[292,294,324],[294,295,296,312,323,324],[294,295,296,309,312,315,324],[324,328],[290,297,302,312,323,324],[294,295,297,298,302,312,320,323,324],[297,299,312,320,323,324],[278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330],[294,300,324],[301,323,324],[290,294,302,312,324],[303,324],[304,324],[281,305,324],[306,322,324,328],[307,324],[308,324],[294,309,310,324],[309,311,324,326],[282,294,312,313,314,315,324],[282,312,314,324],[312,313,324],[315,324],[316,324],[294,318,319,324],[318,319,324],[287,302,312,320,324],[321,324],[302,322,324],[282,297,308,323,324],[287,324],[312,324,325],[324,326],[324,327],[282,287,294,296,305,312,323,324,326,328],[312,324,329],[294,312,324,331],[54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,173,174,175,177,186,188,189,190,191,192,193,195,196,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,324],[99,324],[55,58,324],[57,324],[57,58,324],[54,55,56,58,324],[55,57,58,215,324],[58,324],[54,57,99,324],[57,58,215,324],[57,223,324],[55,57,58,324],[67,324],[90,324],[111,324],[57,58,99,324],[58,106,324],[57,58,99,117,324],[57,58,117,324],[58,158,324],[58,99,324],[54,58,176,324],[54,58,177,324],[199,324],[183,185,324],[194,324],[183,324],[54,58,176,183,184,324],[176,177,185,324],[197,324],[54,58,183,184,185,324],[56,57,58,324],[54,58,324],[55,57,177,178,179,180,324],[99,177,178,179,180,324],[177,179,324],[57,178,179,181,182,186,324],[54,57,324],[58,201,324],[59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,324],[187,324],[324,453,454],[324,453,454,455],[324,456,505]],"referencedMap":[[48,1],[360,2],[361,3],[390,4],[391,5],[392,6],[396,7],[393,8],[394,9],[358,1],[359,10],[395,11],[374,1],[362,1],[363,12],[364,13],[365,1],[366,14],[376,15],[367,1],[368,16],[369,1],[370,1],[371,12],[372,12],[373,12],[375,17],[383,18],[385,1],[382,1],[388,19],[386,1],[384,1],[380,20],[381,21],[387,1],[389,22],[377,1],[379,23],[378,24],[254,1],[257,25],[253,1],[255,1],[256,1],[413,26],[398,26],[405,26],[402,26],[415,26],[406,26],[412,26],[397,1],[416,26],[419,27],[410,26],[400,26],[418,26],[403,26],[401,26],[411,26],[407,26],[417,26],[404,26],[414,26],[399,26],[409,26],[408,26],[422,28],[421,29],[420,1],[453,30],[49,1],[50,1],[51,1],[53,31],[243,32],[244,31],[424,1],[271,1],[272,1],[425,33],[245,1],[426,1],[427,34],[52,1],[247,35],[248,1],[246,36],[249,35],[250,1],[252,37],[264,38],[265,1],[270,39],[266,1],[267,1],[268,1],[269,1],[276,40],[333,41],[277,1],[332,42],[350,43],[334,1],[335,1],[493,44],[263,45],[261,46],[259,47],[260,48],[262,1],[342,49],[336,1],[345,50],[338,51],[343,52],[341,53],[344,54],[339,55],[340,56],[274,57],[346,58],[275,59],[348,60],[349,61],[337,1],[251,1],[258,62],[347,63],[356,64],[351,1],[357,65],[352,66],[353,67],[354,68],[355,69],[423,70],[437,71],[436,1],[442,72],[438,71],[439,73],[441,74],[440,75],[443,76],[430,77],[431,78],[434,79],[433,79],[432,78],[435,78],[429,80],[445,81],[444,82],[447,83],[446,84],[448,85],[449,57],[450,86],[273,1],[451,87],[428,88],[452,89],[457,90],[458,91],[470,92],[471,1],[472,1],[473,93],[474,94],[476,95],[477,96],[478,97],[475,91],[479,98],[505,99],[465,100],[460,101],[462,102],[487,103],[463,104],[481,105],[480,1],[464,106],[484,107],[468,108],[485,1],[486,109],[466,110],[459,111],[467,112],[461,113],[482,114],[489,115],[490,116],[488,117],[491,110],[492,118],[494,119],[496,120],[495,121],[502,122],[469,14],[498,123],[497,14],[500,124],[499,1],[501,125],[483,126],[504,127],[503,14],[278,128],[279,128],[281,129],[282,130],[283,131],[284,132],[285,133],[286,134],[287,135],[288,136],[289,137],[290,138],[291,138],[293,139],[292,140],[294,139],[295,141],[296,142],[280,143],[330,1],[297,144],[298,145],[299,146],[331,147],[300,148],[301,149],[302,150],[303,151],[304,152],[305,153],[306,154],[307,155],[308,156],[309,157],[310,157],[311,158],[312,159],[314,160],[313,161],[315,162],[316,163],[317,1],[318,164],[319,165],[320,166],[321,167],[322,168],[323,169],[324,170],[325,171],[326,172],[327,173],[328,174],[329,175],[507,176],[47,1],[242,177],[215,1],[193,178],[191,178],[241,179],[206,180],[205,180],[106,181],[57,182],[213,181],[214,181],[216,183],[217,181],[218,184],[117,185],[219,181],[190,181],[220,181],[221,186],[222,181],[223,180],[224,187],[225,181],[226,181],[227,181],[228,181],[229,180],[230,181],[231,181],[232,181],[233,181],[234,188],[235,181],[236,181],[237,181],[238,181],[239,181],[56,179],[59,184],[60,184],[61,184],[62,184],[63,184],[64,184],[65,184],[66,181],[68,189],[69,184],[67,184],[70,184],[71,184],[72,184],[73,184],[74,184],[75,184],[76,181],[77,184],[78,184],[79,184],[80,184],[81,184],[82,181],[83,184],[84,184],[85,184],[86,184],[87,184],[88,184],[89,181],[91,190],[90,184],[92,184],[93,184],[94,184],[95,184],[96,188],[97,181],[98,181],[112,191],[100,192],[101,184],[102,184],[103,181],[104,184],[105,184],[107,193],[108,184],[109,184],[110,184],[111,184],[113,184],[114,184],[115,184],[116,184],[118,194],[119,184],[120,184],[121,184],[122,181],[123,184],[124,195],[125,195],[126,195],[127,181],[128,184],[129,184],[130,184],[135,184],[131,184],[132,181],[133,184],[134,181],[136,184],[137,184],[138,184],[139,184],[140,184],[141,184],[142,181],[143,184],[144,184],[145,184],[146,184],[147,184],[148,184],[149,184],[150,184],[151,184],[152,184],[153,184],[154,184],[155,184],[156,184],[157,184],[158,184],[159,196],[160,184],[161,184],[162,184],[163,184],[164,184],[165,184],[166,181],[167,181],[168,181],[169,181],[170,181],[171,184],[172,184],[173,184],[174,184],[192,197],[240,181],[177,198],[176,199],[200,200],[199,201],[195,202],[194,201],[196,203],[185,204],[183,205],[198,206],[197,203],[184,1],[186,207],[99,208],[55,209],[54,184],[189,1],[181,210],[182,211],[179,1],[180,212],[178,184],[187,213],[58,214],[207,1],[208,1],[201,1],[204,180],[203,1],[209,1],[210,1],[202,215],[211,1],[212,1],[175,216],[188,217],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[46,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[455,218],[456,219],[454,14],[506,220]],"exportedModulesMap":[[48,1],[360,2],[361,3],[390,4],[391,5],[392,6],[396,7],[393,8],[394,9],[358,1],[359,10],[395,11],[374,1],[362,1],[363,12],[364,13],[365,1],[366,14],[376,15],[367,1],[368,16],[369,1],[370,1],[371,12],[372,12],[373,12],[375,17],[383,18],[385,1],[382,1],[388,19],[386,1],[384,1],[380,20],[381,21],[387,1],[389,22],[377,1],[379,23],[378,24],[254,1],[257,25],[253,1],[255,1],[256,1],[413,26],[398,26],[405,26],[402,26],[415,26],[406,26],[412,26],[397,1],[416,26],[419,27],[410,26],[400,26],[418,26],[403,26],[401,26],[411,26],[407,26],[417,26],[404,26],[414,26],[399,26],[409,26],[408,26],[422,28],[421,29],[420,1],[453,30],[49,1],[50,1],[51,1],[53,31],[243,32],[244,31],[424,1],[271,1],[272,1],[425,33],[245,1],[426,1],[427,34],[52,1],[247,35],[248,1],[246,36],[249,35],[250,1],[252,37],[264,38],[265,1],[270,39],[266,1],[267,1],[268,1],[269,1],[276,40],[333,41],[277,1],[332,42],[350,43],[334,1],[335,1],[493,44],[263,45],[261,46],[259,47],[260,48],[262,1],[342,49],[336,1],[345,50],[338,51],[343,52],[341,53],[344,54],[339,55],[340,56],[274,57],[346,58],[275,59],[348,60],[349,61],[337,1],[251,1],[258,62],[347,63],[356,64],[351,1],[357,65],[352,66],[353,67],[354,68],[355,69],[423,70],[437,71],[436,1],[442,72],[438,71],[439,73],[441,74],[440,75],[443,76],[430,77],[431,78],[434,79],[433,79],[432,78],[435,78],[429,80],[445,81],[444,82],[447,83],[446,84],[448,85],[449,57],[450,86],[273,1],[451,87],[428,88],[452,89],[457,90],[458,91],[470,92],[471,1],[472,1],[473,93],[474,94],[476,95],[477,96],[478,97],[475,91],[479,98],[505,99],[465,100],[460,101],[462,102],[487,103],[463,104],[481,105],[480,1],[464,106],[484,107],[468,108],[485,1],[486,109],[466,110],[459,111],[467,112],[461,113],[482,114],[489,115],[490,116],[488,117],[491,110],[492,118],[494,119],[496,120],[495,121],[502,122],[469,14],[498,123],[497,14],[500,124],[499,1],[501,125],[483,126],[504,127],[503,14],[278,128],[279,128],[281,129],[282,130],[283,131],[284,132],[285,133],[286,134],[287,135],[288,136],[289,137],[290,138],[291,138],[293,139],[292,140],[294,139],[295,141],[296,142],[280,143],[330,1],[297,144],[298,145],[299,146],[331,147],[300,148],[301,149],[302,150],[303,151],[304,152],[305,153],[306,154],[307,155],[308,156],[309,157],[310,157],[311,158],[312,159],[314,160],[313,161],[315,162],[316,163],[317,1],[318,164],[319,165],[320,166],[321,167],[322,168],[323,169],[324,170],[325,171],[326,172],[327,173],[328,174],[329,175],[507,176],[47,1],[242,177],[215,1],[193,178],[191,178],[241,179],[206,180],[205,180],[106,181],[57,182],[213,181],[214,181],[216,183],[217,181],[218,184],[117,185],[219,181],[190,181],[220,181],[221,186],[222,181],[223,180],[224,187],[225,181],[226,181],[227,181],[228,181],[229,180],[230,181],[231,181],[232,181],[233,181],[234,188],[235,181],[236,181],[237,181],[238,181],[239,181],[56,179],[59,184],[60,184],[61,184],[62,184],[63,184],[64,184],[65,184],[66,181],[68,189],[69,184],[67,184],[70,184],[71,184],[72,184],[73,184],[74,184],[75,184],[76,181],[77,184],[78,184],[79,184],[80,184],[81,184],[82,181],[83,184],[84,184],[85,184],[86,184],[87,184],[88,184],[89,181],[91,190],[90,184],[92,184],[93,184],[94,184],[95,184],[96,188],[97,181],[98,181],[112,191],[100,192],[101,184],[102,184],[103,181],[104,184],[105,184],[107,193],[108,184],[109,184],[110,184],[111,184],[113,184],[114,184],[115,184],[116,184],[118,194],[119,184],[120,184],[121,184],[122,181],[123,184],[124,195],[125,195],[126,195],[127,181],[128,184],[129,184],[130,184],[135,184],[131,184],[132,181],[133,184],[134,181],[136,184],[137,184],[138,184],[139,184],[140,184],[141,184],[142,181],[143,184],[144,184],[145,184],[146,184],[147,184],[148,184],[149,184],[150,184],[151,184],[152,184],[153,184],[154,184],[155,184],[156,184],[157,184],[158,184],[159,196],[160,184],[161,184],[162,184],[163,184],[164,184],[165,184],[166,181],[167,181],[168,181],[169,181],[170,181],[171,184],[172,184],[173,184],[174,184],[192,197],[240,181],[177,198],[176,199],[200,200],[199,201],[195,202],[194,201],[196,203],[185,204],[183,205],[198,206],[197,203],[184,1],[186,207],[99,208],[55,209],[54,184],[189,1],[181,210],[182,211],[179,1],[180,212],[178,184],[187,213],[58,214],[207,1],[208,1],[201,1],[204,180],[203,1],[209,1],[210,1],[202,215],[211,1],[212,1],[175,216],[188,217],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[46,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[455,218],[456,219],[454,14],[506,220]]},"version":"4.9.4"} \ No newline at end of file From 1831418a057f21d3ce8646a94d4f7f3b58c35d08 Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 14:56:10 +0200 Subject: [PATCH 02/78] delete useless code --- src/database/db.js | 14 -------------- src/database/repositories/category.js | 2 +- src/database/repositories/index.js | 11 ----------- src/database/repositories/recipe.js | 2 +- src/database/repositories/user.js | 1 - src/server/user.controller.ts | 2 +- 6 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 src/database/db.js delete mode 100644 src/database/repositories/index.js diff --git a/src/database/db.js b/src/database/db.js deleted file mode 100644 index c274213..0000000 --- a/src/database/db.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -require('dotenv').config(); -const { PrismaClient } = require('@prisma/client'); -const repositories = require('./repositories'); - -const prisma = new PrismaClient(); - -//usage example -(async () => { - const recipe = new repositories.RecipeRepository(prisma); - const data = await recipe.findAll(); - console.log(data); -})(); diff --git a/src/database/repositories/category.js b/src/database/repositories/category.js index 4142b72..8aaf8bb 100644 --- a/src/database/repositories/category.js +++ b/src/database/repositories/category.js @@ -25,4 +25,4 @@ class CategoryRepository { } } -module.exports = CategoryRepository; +exports.CategoryRepository = CategoryRepository; diff --git a/src/database/repositories/index.js b/src/database/repositories/index.js deleted file mode 100644 index 99f7042..0000000 --- a/src/database/repositories/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const UserRepository = require('./user'); -const RecipeRepository = require('./recipe'); -const CategoryRepository = require('./category'); - -module.exports = { - UserRepository, - RecipeRepository, - CategoryRepository, -}; diff --git a/src/database/repositories/recipe.js b/src/database/repositories/recipe.js index a3a62b9..81aa797 100644 --- a/src/database/repositories/recipe.js +++ b/src/database/repositories/recipe.js @@ -69,4 +69,4 @@ class RecipeRepository { } } -module.exports = RecipeRepository; +exports.RecipeRepository = RecipeRepository; diff --git a/src/database/repositories/user.js b/src/database/repositories/user.js index a709e9b..2f4b3f6 100644 --- a/src/database/repositories/user.js +++ b/src/database/repositories/user.js @@ -72,4 +72,3 @@ class UserRepository { } exports.UserRepository = UserRepository; -// module.exports = UserRepository; diff --git a/src/server/user.controller.ts b/src/server/user.controller.ts index d8a40f4..1094043 100644 --- a/src/server/user.controller.ts +++ b/src/server/user.controller.ts @@ -10,7 +10,7 @@ import { } from '@nestjs/common'; import { PrismaService } from './prisma.service'; import { users as UserModel, Prisma } from '@prisma/client'; -import { UserRepository } from '../database/repositories/user.js'; +import { UserRepository } from '../database/repositories/user'; const prisma = new PrismaService(); const user = new UserRepository(prisma); From f75fbf208a6d07265c51894031954290d7d9887c Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:10:18 +0200 Subject: [PATCH 03/78] add @nestjs/cli dependancy --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 21a2205..1582678 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@nestjs/cli": "^9.1.8", "@nestjs/common": "^9.2.1", "@nestjs/core": "^9.2.1", "@nestjs/platform-express": "^9.2.1", From 89f879b1eb6bfc7ea5123b61849b4a59387bc1cb Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:32:02 +0200 Subject: [PATCH 04/78] upd readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 40d14cd..2a85175 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ PORT = 3000 || any other port JWT_ACCESS_SECRET = "your secret key" ``` +#### To generate prisma client +```bash +npx prisma generate --schema=./src/database/prisma/schema.prisma +``` + #### To start parser: ```bash /src/parser/ node index.js From 442b987cdd0342622a5bff8b482176b7114a71cd Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:57:08 +0200 Subject: [PATCH 05/78] add dotenv --- src/server/main.ts | 2 ++ tsconfig.build.tsbuildinfo | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 tsconfig.build.tsbuildinfo diff --git a/src/server/main.ts b/src/server/main.ts index 13cad38..acf994f 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -1,5 +1,7 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import * as dotenv from 'dotenv' +dotenv.config() async function bootstrap() { const app = await NestFactory.create(AppModule); diff --git a/tsconfig.build.tsbuildinfo b/tsconfig.build.tsbuildinfo deleted file mode 100644 index 2eb0d53..0000000 --- a/tsconfig.build.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.es2017.full.d.ts","./node_modules/reflect-metadata/index.d.ts","./node_modules/@nestjs/common/cache/cache.constants.d.ts","./node_modules/@nestjs/common/interfaces/abstract.interface.d.ts","./node_modules/@nestjs/common/interfaces/controllers/controller-metadata.interface.d.ts","./node_modules/@nestjs/common/interfaces/controllers/controller.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/arguments-host.interface.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/exception-filter.interface.d.ts","./node_modules/rxjs/dist/types/internal/subscription.d.ts","./node_modules/rxjs/dist/types/internal/subscriber.d.ts","./node_modules/rxjs/dist/types/internal/operator.d.ts","./node_modules/rxjs/dist/types/internal/observable.d.ts","./node_modules/rxjs/dist/types/internal/types.d.ts","./node_modules/rxjs/dist/types/internal/operators/audit.d.ts","./node_modules/rxjs/dist/types/internal/operators/audittime.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffer.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffercount.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffertime.d.ts","./node_modules/rxjs/dist/types/internal/operators/buffertoggle.d.ts","./node_modules/rxjs/dist/types/internal/operators/bufferwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/catcherror.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatestall.d.ts","./node_modules/rxjs/dist/types/internal/operators/combineall.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatest.d.ts","./node_modules/rxjs/dist/types/internal/operators/combinelatestwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/concat.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatall.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatmapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/concatwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/connect.d.ts","./node_modules/rxjs/dist/types/internal/operators/count.d.ts","./node_modules/rxjs/dist/types/internal/operators/debounce.d.ts","./node_modules/rxjs/dist/types/internal/operators/debouncetime.d.ts","./node_modules/rxjs/dist/types/internal/operators/defaultifempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/delay.d.ts","./node_modules/rxjs/dist/types/internal/operators/delaywhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinct.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinctuntilchanged.d.ts","./node_modules/rxjs/dist/types/internal/operators/distinctuntilkeychanged.d.ts","./node_modules/rxjs/dist/types/internal/operators/elementat.d.ts","./node_modules/rxjs/dist/types/internal/operators/endwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/every.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaustall.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts","./node_modules/rxjs/dist/types/internal/operators/exhaustmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/expand.d.ts","./node_modules/rxjs/dist/types/internal/operators/filter.d.ts","./node_modules/rxjs/dist/types/internal/operators/finalize.d.ts","./node_modules/rxjs/dist/types/internal/operators/find.d.ts","./node_modules/rxjs/dist/types/internal/operators/findindex.d.ts","./node_modules/rxjs/dist/types/internal/operators/first.d.ts","./node_modules/rxjs/dist/types/internal/subject.d.ts","./node_modules/rxjs/dist/types/internal/operators/groupby.d.ts","./node_modules/rxjs/dist/types/internal/operators/ignoreelements.d.ts","./node_modules/rxjs/dist/types/internal/operators/isempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/last.d.ts","./node_modules/rxjs/dist/types/internal/operators/map.d.ts","./node_modules/rxjs/dist/types/internal/operators/mapto.d.ts","./node_modules/rxjs/dist/types/internal/notification.d.ts","./node_modules/rxjs/dist/types/internal/operators/materialize.d.ts","./node_modules/rxjs/dist/types/internal/operators/max.d.ts","./node_modules/rxjs/dist/types/internal/operators/merge.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergeall.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergemap.d.ts","./node_modules/rxjs/dist/types/internal/operators/flatmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergemapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergescan.d.ts","./node_modules/rxjs/dist/types/internal/operators/mergewith.d.ts","./node_modules/rxjs/dist/types/internal/operators/min.d.ts","./node_modules/rxjs/dist/types/internal/observable/connectableobservable.d.ts","./node_modules/rxjs/dist/types/internal/operators/multicast.d.ts","./node_modules/rxjs/dist/types/internal/operators/observeon.d.ts","./node_modules/rxjs/dist/types/internal/operators/onerrorresumenextwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts","./node_modules/rxjs/dist/types/internal/operators/partition.d.ts","./node_modules/rxjs/dist/types/internal/operators/pluck.d.ts","./node_modules/rxjs/dist/types/internal/operators/publish.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishbehavior.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishlast.d.ts","./node_modules/rxjs/dist/types/internal/operators/publishreplay.d.ts","./node_modules/rxjs/dist/types/internal/operators/race.d.ts","./node_modules/rxjs/dist/types/internal/operators/racewith.d.ts","./node_modules/rxjs/dist/types/internal/operators/reduce.d.ts","./node_modules/rxjs/dist/types/internal/operators/repeat.d.ts","./node_modules/rxjs/dist/types/internal/operators/repeatwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/retry.d.ts","./node_modules/rxjs/dist/types/internal/operators/retrywhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/refcount.d.ts","./node_modules/rxjs/dist/types/internal/operators/sample.d.ts","./node_modules/rxjs/dist/types/internal/operators/sampletime.d.ts","./node_modules/rxjs/dist/types/internal/operators/scan.d.ts","./node_modules/rxjs/dist/types/internal/operators/sequenceequal.d.ts","./node_modules/rxjs/dist/types/internal/operators/share.d.ts","./node_modules/rxjs/dist/types/internal/operators/sharereplay.d.ts","./node_modules/rxjs/dist/types/internal/operators/single.d.ts","./node_modules/rxjs/dist/types/internal/operators/skip.d.ts","./node_modules/rxjs/dist/types/internal/operators/skiplast.d.ts","./node_modules/rxjs/dist/types/internal/operators/skipuntil.d.ts","./node_modules/rxjs/dist/types/internal/operators/skipwhile.d.ts","./node_modules/rxjs/dist/types/internal/operators/startwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/subscribeon.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchall.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchmap.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchmapto.d.ts","./node_modules/rxjs/dist/types/internal/operators/switchscan.d.ts","./node_modules/rxjs/dist/types/internal/operators/take.d.ts","./node_modules/rxjs/dist/types/internal/operators/takelast.d.ts","./node_modules/rxjs/dist/types/internal/operators/takeuntil.d.ts","./node_modules/rxjs/dist/types/internal/operators/takewhile.d.ts","./node_modules/rxjs/dist/types/internal/operators/tap.d.ts","./node_modules/rxjs/dist/types/internal/operators/throttle.d.ts","./node_modules/rxjs/dist/types/internal/operators/throttletime.d.ts","./node_modules/rxjs/dist/types/internal/operators/throwifempty.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeinterval.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeout.d.ts","./node_modules/rxjs/dist/types/internal/operators/timeoutwith.d.ts","./node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts","./node_modules/rxjs/dist/types/internal/operators/toarray.d.ts","./node_modules/rxjs/dist/types/internal/operators/window.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowcount.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowtime.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowtoggle.d.ts","./node_modules/rxjs/dist/types/internal/operators/windowwhen.d.ts","./node_modules/rxjs/dist/types/internal/operators/withlatestfrom.d.ts","./node_modules/rxjs/dist/types/internal/operators/zip.d.ts","./node_modules/rxjs/dist/types/internal/operators/zipall.d.ts","./node_modules/rxjs/dist/types/internal/operators/zipwith.d.ts","./node_modules/rxjs/dist/types/operators/index.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/action.d.ts","./node_modules/rxjs/dist/types/internal/scheduler.d.ts","./node_modules/rxjs/dist/types/internal/testing/testmessage.d.ts","./node_modules/rxjs/dist/types/internal/testing/subscriptionlog.d.ts","./node_modules/rxjs/dist/types/internal/testing/subscriptionloggable.d.ts","./node_modules/rxjs/dist/types/internal/testing/coldobservable.d.ts","./node_modules/rxjs/dist/types/internal/testing/hotobservable.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asyncscheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/timerhandle.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asyncaction.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/virtualtimescheduler.d.ts","./node_modules/rxjs/dist/types/internal/testing/testscheduler.d.ts","./node_modules/rxjs/dist/types/testing/index.d.ts","./node_modules/rxjs/dist/types/internal/symbol/observable.d.ts","./node_modules/rxjs/dist/types/internal/observable/dom/animationframes.d.ts","./node_modules/rxjs/dist/types/internal/behaviorsubject.d.ts","./node_modules/rxjs/dist/types/internal/replaysubject.d.ts","./node_modules/rxjs/dist/types/internal/asyncsubject.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asapscheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/async.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/queuescheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/animationframescheduler.d.ts","./node_modules/rxjs/dist/types/internal/scheduler/animationframe.d.ts","./node_modules/rxjs/dist/types/internal/util/identity.d.ts","./node_modules/rxjs/dist/types/internal/util/pipe.d.ts","./node_modules/rxjs/dist/types/internal/util/noop.d.ts","./node_modules/rxjs/dist/types/internal/util/isobservable.d.ts","./node_modules/rxjs/dist/types/internal/lastvaluefrom.d.ts","./node_modules/rxjs/dist/types/internal/firstvaluefrom.d.ts","./node_modules/rxjs/dist/types/internal/util/argumentoutofrangeerror.d.ts","./node_modules/rxjs/dist/types/internal/util/emptyerror.d.ts","./node_modules/rxjs/dist/types/internal/util/notfounderror.d.ts","./node_modules/rxjs/dist/types/internal/util/objectunsubscribederror.d.ts","./node_modules/rxjs/dist/types/internal/util/sequenceerror.d.ts","./node_modules/rxjs/dist/types/internal/util/unsubscriptionerror.d.ts","./node_modules/rxjs/dist/types/internal/observable/bindcallback.d.ts","./node_modules/rxjs/dist/types/internal/observable/bindnodecallback.d.ts","./node_modules/rxjs/dist/types/internal/anycatcher.d.ts","./node_modules/rxjs/dist/types/internal/observable/combinelatest.d.ts","./node_modules/rxjs/dist/types/internal/observable/concat.d.ts","./node_modules/rxjs/dist/types/internal/observable/connectable.d.ts","./node_modules/rxjs/dist/types/internal/observable/defer.d.ts","./node_modules/rxjs/dist/types/internal/observable/empty.d.ts","./node_modules/rxjs/dist/types/internal/observable/forkjoin.d.ts","./node_modules/rxjs/dist/types/internal/observable/from.d.ts","./node_modules/rxjs/dist/types/internal/observable/fromevent.d.ts","./node_modules/rxjs/dist/types/internal/observable/fromeventpattern.d.ts","./node_modules/rxjs/dist/types/internal/observable/generate.d.ts","./node_modules/rxjs/dist/types/internal/observable/iif.d.ts","./node_modules/rxjs/dist/types/internal/observable/interval.d.ts","./node_modules/rxjs/dist/types/internal/observable/merge.d.ts","./node_modules/rxjs/dist/types/internal/observable/never.d.ts","./node_modules/rxjs/dist/types/internal/observable/of.d.ts","./node_modules/rxjs/dist/types/internal/observable/onerrorresumenext.d.ts","./node_modules/rxjs/dist/types/internal/observable/pairs.d.ts","./node_modules/rxjs/dist/types/internal/observable/partition.d.ts","./node_modules/rxjs/dist/types/internal/observable/race.d.ts","./node_modules/rxjs/dist/types/internal/observable/range.d.ts","./node_modules/rxjs/dist/types/internal/observable/throwerror.d.ts","./node_modules/rxjs/dist/types/internal/observable/timer.d.ts","./node_modules/rxjs/dist/types/internal/observable/using.d.ts","./node_modules/rxjs/dist/types/internal/observable/zip.d.ts","./node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts","./node_modules/rxjs/dist/types/internal/config.d.ts","./node_modules/rxjs/dist/types/index.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/rpc-exception-filter.interface.d.ts","./node_modules/@nestjs/common/interfaces/exceptions/ws-exception-filter.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validation-error.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/execution-context.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/can-activate.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/custom-route-param-factory.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/nest-interceptor.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/paramtype.interface.d.ts","./node_modules/@nestjs/common/interfaces/type.interface.d.ts","./node_modules/@nestjs/common/interfaces/features/pipe-transform.interface.d.ts","./node_modules/@nestjs/common/enums/request-method.enum.d.ts","./node_modules/@nestjs/common/enums/http-status.enum.d.ts","./node_modules/@nestjs/common/enums/shutdown-signal.enum.d.ts","./node_modules/@nestjs/common/enums/version-type.enum.d.ts","./node_modules/@nestjs/common/enums/index.d.ts","./node_modules/@nestjs/common/interfaces/version-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-configuration.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-consumer.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/middleware-config-proxy.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/nest-middleware.interface.d.ts","./node_modules/@nestjs/common/interfaces/middleware/index.d.ts","./node_modules/@nestjs/common/interfaces/global-prefix-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/before-application-shutdown.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-application-bootstrap.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-application-shutdown.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-destroy.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/on-init.interface.d.ts","./node_modules/@nestjs/common/interfaces/hooks/index.d.ts","./node_modules/@nestjs/common/interfaces/external/cors-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/https-options.interface.d.ts","./node_modules/@nestjs/common/services/logger.service.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-context-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/http-server.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/message-event.interface.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@nestjs/common/interfaces/http/raw-body-request.interface.d.ts","./node_modules/@nestjs/common/interfaces/http/index.d.ts","./node_modules/@nestjs/common/interfaces/injectable.interface.d.ts","./node_modules/@nestjs/common/interfaces/microservices/nest-hybrid-application-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/forward-reference.interface.d.ts","./node_modules/@nestjs/common/interfaces/scope-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/injection-token.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/optional-factory-dependency.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/provider.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/module-metadata.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/dynamic-module.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/introspection-result.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/nest-module.interface.d.ts","./node_modules/@nestjs/common/interfaces/modules/index.d.ts","./node_modules/@nestjs/common/interfaces/nest-application-context.interface.d.ts","./node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-application.interface.d.ts","./node_modules/@nestjs/common/interfaces/nest-microservice.interface.d.ts","./node_modules/@nestjs/common/interfaces/index.d.ts","./node_modules/@nestjs/common/module-utils/constants.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.d.ts","./node_modules/@nestjs/common/module-utils/interfaces/index.d.ts","./node_modules/@nestjs/common/module-utils/configurable-module.builder.d.ts","./node_modules/@nestjs/common/module-utils/index.d.ts","./node_modules/@nestjs/common/cache/interfaces/cache-manager.interface.d.ts","./node_modules/@nestjs/common/cache/interfaces/cache-module.interface.d.ts","./node_modules/@nestjs/common/cache/cache.module-definition.d.ts","./node_modules/@nestjs/common/cache/cache.module.d.ts","./node_modules/@nestjs/common/decorators/core/bind.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/catch.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/controller.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/dependencies.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/exception-filters.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/inject.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/injectable.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/optional.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/set-metadata.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-guards.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-interceptors.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/use-pipes.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/apply-decorators.d.ts","./node_modules/@nestjs/common/decorators/core/version.decorator.d.ts","./node_modules/@nestjs/common/decorators/core/index.d.ts","./node_modules/@nestjs/common/decorators/modules/global.decorator.d.ts","./node_modules/@nestjs/common/decorators/modules/module.decorator.d.ts","./node_modules/@nestjs/common/decorators/modules/index.d.ts","./node_modules/@nestjs/common/decorators/http/request-mapping.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/route-params.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/http-code.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/create-route-param-metadata.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/render.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/header.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/redirect.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/sse.decorator.d.ts","./node_modules/@nestjs/common/decorators/http/index.d.ts","./node_modules/@nestjs/common/decorators/index.d.ts","./node_modules/@nestjs/common/cache/decorators/cache-key.decorator.d.ts","./node_modules/@nestjs/common/cache/decorators/cache-ttl.decorator.d.ts","./node_modules/@nestjs/common/cache/decorators/index.d.ts","./node_modules/@nestjs/common/cache/interceptors/cache.interceptor.d.ts","./node_modules/@nestjs/common/cache/interceptors/index.d.ts","./node_modules/@nestjs/common/cache/interfaces/index.d.ts","./node_modules/@nestjs/common/cache/index.d.ts","./node_modules/@nestjs/common/exceptions/http.exception.d.ts","./node_modules/@nestjs/common/exceptions/bad-request.exception.d.ts","./node_modules/@nestjs/common/exceptions/unauthorized.exception.d.ts","./node_modules/@nestjs/common/exceptions/method-not-allowed.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-found.exception.d.ts","./node_modules/@nestjs/common/exceptions/forbidden.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-acceptable.exception.d.ts","./node_modules/@nestjs/common/exceptions/request-timeout.exception.d.ts","./node_modules/@nestjs/common/exceptions/conflict.exception.d.ts","./node_modules/@nestjs/common/exceptions/gone.exception.d.ts","./node_modules/@nestjs/common/exceptions/payload-too-large.exception.d.ts","./node_modules/@nestjs/common/exceptions/unsupported-media-type.exception.d.ts","./node_modules/@nestjs/common/exceptions/unprocessable-entity.exception.d.ts","./node_modules/@nestjs/common/exceptions/internal-server-error.exception.d.ts","./node_modules/@nestjs/common/exceptions/not-implemented.exception.d.ts","./node_modules/@nestjs/common/exceptions/http-version-not-supported.exception.d.ts","./node_modules/@nestjs/common/exceptions/bad-gateway.exception.d.ts","./node_modules/@nestjs/common/exceptions/service-unavailable.exception.d.ts","./node_modules/@nestjs/common/exceptions/gateway-timeout.exception.d.ts","./node_modules/@nestjs/common/exceptions/im-a-teapot.exception.d.ts","./node_modules/@nestjs/common/exceptions/precondition-failed.exception.d.ts","./node_modules/@nestjs/common/exceptions/misdirected.exception.d.ts","./node_modules/@nestjs/common/exceptions/index.d.ts","./node_modules/@nestjs/common/file-stream/streamable-options.interface.d.ts","./node_modules/@nestjs/common/file-stream/streamable-file.d.ts","./node_modules/@nestjs/common/file-stream/index.d.ts","./node_modules/@nestjs/common/pipes/default-value.pipe.d.ts","./node_modules/@nestjs/common/interfaces/external/class-transform-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/transformer-package.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validator-options.interface.d.ts","./node_modules/@nestjs/common/interfaces/external/validator-package.interface.d.ts","./node_modules/@nestjs/common/utils/http-error-by-code.util.d.ts","./node_modules/@nestjs/common/pipes/validation.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-array.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-bool.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-int.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-float.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-enum.pipe.d.ts","./node_modules/@nestjs/common/pipes/parse-uuid.pipe.d.ts","./node_modules/@nestjs/common/pipes/file/file-validator.interface.d.ts","./node_modules/@nestjs/common/pipes/file/file-type.validator.d.ts","./node_modules/@nestjs/common/pipes/file/max-file-size.validator.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file-options.interface.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file.pipe.d.ts","./node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.d.ts","./node_modules/@nestjs/common/pipes/file/index.d.ts","./node_modules/@nestjs/common/pipes/index.d.ts","./node_modules/@nestjs/common/serializer/class-serializer.interfaces.d.ts","./node_modules/@nestjs/common/serializer/class-serializer.interceptor.d.ts","./node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.d.ts","./node_modules/@nestjs/common/serializer/decorators/index.d.ts","./node_modules/@nestjs/common/serializer/index.d.ts","./node_modules/@nestjs/common/services/console-logger.service.d.ts","./node_modules/@nestjs/common/services/index.d.ts","./node_modules/@nestjs/common/utils/forward-ref.util.d.ts","./node_modules/@nestjs/common/utils/index.d.ts","./node_modules/@nestjs/common/index.d.ts","./src/server/app.service.ts","./src/server/app.controller.ts","./src/server/app.module.ts","./node_modules/@nestjs/core/adapters/http-adapter.d.ts","./node_modules/@nestjs/core/adapters/index.d.ts","./node_modules/@nestjs/core/injector/module-token-factory.d.ts","./node_modules/@nestjs/core/injector/compiler.d.ts","./node_modules/@nestjs/core/injector/modules-container.d.ts","./node_modules/@nestjs/core/injector/container.d.ts","./node_modules/@nestjs/core/injector/injector.d.ts","./node_modules/@nestjs/core/injector/instance-links-host.d.ts","./node_modules/@nestjs/core/injector/abstract-instance-resolver.d.ts","./node_modules/@nestjs/core/injector/module-ref.d.ts","./node_modules/@nestjs/core/injector/module.d.ts","./node_modules/@nestjs/core/injector/instance-wrapper.d.ts","./node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.d.ts","./node_modules/@nestjs/core/application-config.d.ts","./node_modules/@nestjs/core/constants.d.ts","./node_modules/@nestjs/core/discovery/discovery-module.d.ts","./node_modules/@nestjs/core/discovery/discovery-service.d.ts","./node_modules/@nestjs/core/discovery/index.d.ts","./node_modules/@nestjs/core/helpers/http-adapter-host.d.ts","./node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts","./node_modules/@nestjs/core/exceptions/index.d.ts","./node_modules/@nestjs/core/helpers/context-id-factory.d.ts","./node_modules/@nestjs/core/helpers/index.d.ts","./node_modules/@nestjs/core/injector/inquirer/inquirer-constants.d.ts","./node_modules/@nestjs/core/injector/inquirer/index.d.ts","./node_modules/@nestjs/core/metadata-scanner.d.ts","./node_modules/@nestjs/core/scanner.d.ts","./node_modules/@nestjs/core/injector/instance-loader.d.ts","./node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts","./node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.d.ts","./node_modules/@nestjs/core/injector/index.d.ts","./node_modules/@nestjs/core/middleware/routes-mapper.d.ts","./node_modules/@nestjs/core/middleware/builder.d.ts","./node_modules/@nestjs/core/middleware/index.d.ts","./node_modules/@nestjs/core/nest-application-context.d.ts","./node_modules/@nestjs/core/nest-application.d.ts","./node_modules/@nestjs/common/interfaces/microservices/nest-microservice-options.interface.d.ts","./node_modules/@nestjs/core/nest-factory.d.ts","./node_modules/@nestjs/core/repl/repl.d.ts","./node_modules/@nestjs/core/repl/index.d.ts","./node_modules/@nestjs/core/router/interfaces/routes.interface.d.ts","./node_modules/@nestjs/core/router/interfaces/index.d.ts","./node_modules/@nestjs/core/router/request/request-constants.d.ts","./node_modules/@nestjs/core/router/request/index.d.ts","./node_modules/@nestjs/core/router/router-module.d.ts","./node_modules/@nestjs/core/router/index.d.ts","./node_modules/@nestjs/core/services/reflector.service.d.ts","./node_modules/@nestjs/core/services/index.d.ts","./node_modules/@nestjs/core/index.d.ts","./src/server/main.ts","./node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"3284e33a45d6aa8324691ac5737d08695e35e99b5f69fdc9ef21b3c7e7fd8449","e89535c3ec439608bcd0f68af555d0e5ddf121c54abe69343549718bd7506b9c","622a984b60c294ffb2f9152cf1d4d12e91d2b733d820eec949cf54d63a3c1025","1a25c4d02a013b4690efa24ab48184a2c10b1906a379565ba558b2c3ba679a6d","ba6f9c5491bcf018dbbc813e1dd488beb26f876b825007ba76db485df341a8ee","75b57b109d774acca1e151df21cf5cb54c7a1df33a273f0457b9aee4ebd36fb9","fa3d0cd03fa17459d9ddd98b120b4bb084da39f0391cbdce480a6ef74be0cc7a","e3fd84e6470b7e0679c4073ee5ce971d324182486dde5a49b67cae29168b51d2","dd8331d0a5190a4735ce6c152e420230188c4966067a756673c36dd7ba72b10e","d6db3bf60a324f74ed9c1281acc1543734be70ac0ab9a8dc953a1d55f6906720",{"version":"d57e7ff5243e0dcd04cf2edf9ad9520af40edd6eba31c14c3f405f0c437fa379","affectsGlobalScope":true},"0f882d4ae58f431454030289154feb0132e1b00ca5c3197c6b749bd098aed73a","7ff7f4632a6e7b6872fb1843f3c0df495b49840eae2a23c6fbc943f863da8c29","1e352dc6863536f881c894f17c46b5040db7c9423a18957a8fbc001dfe579b78","a78590b0efcef281236e3234520c348d63be1d4561b63b20e6c3b6fc18b37dfb","4d59c6a10b6c79a0927c79efa89b3c9f71d174ec14ec2792076cfd2330d0cf8e","a496f51933422872de22729b7a0233589325a1a1707cccd05cd914098944a202","75b6663bc569724017997481b6b3774065c204b316cb4f5ad7df3b5162d2dce1","06a38095ad4368314366bc08f7cbc0fe274ef7321ec611005d0bdd9c6565e4d5","4599793db9aed9b84677f0ca1cf7ef3c69bb91cda4fe4329cbab778ca4d80a58","ad0028f96921778931fb8419d8de33b10908314fa99699de1702020f69235da1","ccd2a35321c0786bd3808042dc43b960cac13f2cc660ac37a0087e12bc97d2fc","df524ed01de4f19efb44bded628dbba9f840148be4b6cfe096e29d4b01589de3","2e3981b9cee48174ff85ae15019fd72933f7023a4ed05094740f7e6f7775623c","836ebdc3b9e4c006acc4f405b7e558e56d47830e05c40d991b1e27fe8bc91157","2cc6b617c6120ba64b5778ccd4b74c951adc3a3941bb6b39f47d48701c44af39","eca02b99615a8f1652e21399d832618e38bf166c0747c9247349bc901a2f7741","7f7d6d42e5780e86f5b860a6f95179fae06a368b3af28c1c4230397c47021a59","4740a7d11ab3b381be0f269f1903fb3ff226a2fba55a01756b2997e67cd853f2","863dbc4e77f0353e6f9d6bc0e2b4622d5c07ff6f099ff66cafd7924b2ff4dd3f","bf034a18ed7e2a058f9e48c4c2480a124138fbd3586a80c77736a9ec079d12a8","f88758992a0bf13d095520aacd4381fb456ff121fb9aa184e6eb0eecb26cfadc","c249e9ae33bfcad97deec3c73c9ed2656e112fbdf22deace0b39724be6a5dcf0","d8b45924965c0c4fc0b946c0b6d597aa8d5de9cdf5c727e3d39422d17efec438","c6f72b9a53b7819f056268c221d7eeb14c26e2582aa1547b0f6922d65bcfde72","feddabf6ab0eb191e721f0126f3db8688db97c77a1234968bde7a2d70c4ae513","a968efe0db090c2ed75ee8c77162534f7ffde3dfa9d9ee9f79c47784c43df96e","cde0568b836865a24f4ee5859462004a326dfb76d514e6f56c8e78feedebed58","7f5cb3a03588ed46d52a6c2138315d930cd6ffb5c2134247cd07bc23cbea0b5a","7797f4c91491dcb0f21fa318fd8a1014990d5a72f8a32de2af06eb4d4476a3b5","f39fb20b83c3f9853c13d4ac95533760979d3023c0a5affe2c0a62d91ab3afd8","e4fca08aed8afb32bb8643d7469810bc8681115fe398e56a028df9e73b2d867f","2622639d24718ddfccc33a9a6daf5a2dd94d540ca41e3da00fe365d2c3f25db3","078966067552650f44ca96c68eddbb8539f30ee48a9ab3f24abdcf0a4037b535","2cd6250c43dba360377481c98d48db6ab1532a7527339edb0deffddc28ba66b1","7a9d600990fbe263a23daebed9ba1bbc5761e45679a7e2b2774a42756ef077a2","66bc155515fbea8c31a4efccbbac44de7c037b01f3aa00b76312cf7252725d30","5703288ddbfc4f7845cdbf80c6af17c8cde2a228757479796c2378b1662fcd48","0dfd353f0c16dd5107a7e0713dc52d0a2538293b0a0eac6000a017f9c0a60b56","9cd683a4663ef4d9c6486f1b8a34c73bdbc344d69490931bfe2fbcada12ab35b","42f6a409bad5259ece69df25d2b8ace2ff2ade45fe6386ee45203bdd9329f971","d3b1a8b87a5e77d70056325e137a0e04d984b991546fdd3c1034ff4102d603c4","2eb162efd6dba5972b9f8f85141d900d09da4fba23864f287f98f9890a05e95f","3f878fb5be9ebe8bd0ac5c22515d42b8b72d3745ef7617e73e9b2548ccbdf54b","e9ed562b7599c8c8c01595891480a30f9945a93a46456d22ee67ebf346b7538a","e7bf975a98cecefe2e8902fb7da9314675ecdce553aea722aaec97327668e18b","3d36f93648518338c875d9f77a8eab52905365483dbb3afe43ed68f1b712b67c","4fa54df9184d291bd78b36f5063372042cd995460e906cb14014e40d1442a326","b4e32bd5e3b493e4ea6b5ec69a4c02aa1fdaa78e1df9a863bb07604de8f9d123","f6bd1aa152ca2b5064e06282ee3137842ae6825b6b09aa89a2ff063b976a56f3","bce2390bb3a76f8bf2ba4397c66db5277bf3e698ee614347e5eb79d7fc0942c6","fbdc8d7cc7daf4101bf567512c67fb990d8fe300e0ba7f213171192177f44aa0","298e0da6d858e39fc0c1eebfa4f5c8af487868c6f2e98c3ef800537d402fb5c3","3b6457fb3866562d279377f923cf3758c80ed7bfcc19414b72a24d0a98188e0c","4fb5d7efb3520b92c1b767ce18968057c5e70886d7fb3416c487231df9275af9","df2303a61eb57b2717d17123e82bc0f3fd60f6e4673cb5506192dfe23c9480bf","b104960f4c5f807535ab43282356b2fe29c5d14a02035c623ac2012be3d5f76c","a35ca245eb852b70b20300546443abb1fcbac6e5066e4baaa092af4ea614d9b5","55da140feab55f10a538a9879a97c4be3df4934cbd679665c91a7263a86095e1","1a39e51e3362aec7d4edec9b317ff83916fe0471f86ddf2d3ef3af5952e87d9e","4b3f36b96f129a8e125c91d41a05f711e73b3285f80bceb3a1aecb13c97c4502","852779920fc4220bc42ec6d3c9b6164e23ea9371a788531b48b4005fe0cb4392","6863aa26d38fb3c96d7b04547d677967d83ebe421a093e4dede6fd48ad23890d","515b97cede17d91c9669cc1c7fb7a8a5f0a5f2d8999f925a5f70b4ebea93723e","08e8e57241f874bdbf69ab2b65cb0ee18b4183d5c9452937da49b934fc679c4b","944af466f063d4bd090ab9d988c620b90a014e919d5f78963f6074a136ea225e","644addd4811636da491c9546654bc005ba8599f23df6d731d91eba86f3137fc2","a9249493114b181814728cbfeb7234738193a4169b654ec4705d48d7a4d25222","aad6f20d6eb01192ae02294361faa6e1f320d72447b56f433db853bbe80b15ca","876fbedec2f494eb6f834ce8636b07d581c657d205d81a3ba894eff0facc6b84","58527aa45f11c9b259a6a9d78b397f35020bfbb104f4d3bb177039b5c18146bd","91b8b61d45b5d22f3458a4ac82e03b464a0926bab795a920fe0eca805ec476eb","2744532f8fb960eb78497ac660db719f503a10c801f87131d26fd9cbef75dcef","6884287c54891ac19cfbe056f3ed29cab1732a00dec69bd3b140ce62c11783c6","223fdd3984d951378c7febea213b287ee04ee013f065a27905c3d75df85144c4","cb46657d3237f80742d5701ebcced8f6e5cf8938442354387d6c77d7048dfae6","3965c8ef8150ca688978430a13db460d29a50afc50c97315c723722b6f763369","661f322e45545a554e4ffc38db6c4068a66e1323baf66acb0d8a9fa28195a669","9d787416f04d0867e8a46c317056f6ad365e328074c73fa3a1612285fa24465d","ce978e20a6f26f606b535f0d6deb384ae6a73f8d0bd0dfca0925f5317cad1f25","f2d3567210ca4d559d8297d6c4402599c93e3bc7485054192d38db5e132fbc0a","50d22a2dfdbf2dda7b333edf980566feb3f61813695c8f3b52fc866c8d969404","bdb95f4b6e845ec1c0ae95eb448c55a68a2752473e1d2107348abe40421cc202","ea546a7ed9eaa71ba78d4d392509dadea4bafed283269dd6c4b09e7d8824e986","4ec0f2a141a9ae7d3557b8efe630ac2021bc3a9ac61238b59293f4cf2f196e82","b2db743c71652e03c52d51445af58d0af3316231faa92b66018b29c7ba975f6c","0863a5876c85fbaffbb8ec8aeda8b5042deb6932616139706d2b82cde9d3f7c7","12f8b72e3c3a333814f4fa87d5b9a7ef1ece703f3b7ec7919ad2ffb58c48c1db","ba9c46725e2a0bd9df59d3a1e801cc60f90db3ef7817131c53945dce2b8c0c56","281d373eeabf80c4851f8de991e6abe4d385c30379d80897bbc3df3dcac99cee","624c5dce95672d9dcca40d9d9d82ef855f5f902292f43aa265cc8fd963c6ce84","8a48d9c6184992d1c3ed5daa55f83d708c37582916926a5555a900608f804b60","605dd288c636cf9b5317fe76dec75d3c7fb855fdcd3ee8cb4fea7d7091ca6fb4","95addea67857d4e568a02e429b15458cec203876b2ea5f5ea18ccfeeb91b8ce0","b5a615b0ad865ffa562980a10bda162ac1744fd363b4edc2cfc664222071cbcf","bbccd721363897950a55ce09529503f25a69522e5c91a22679b66e941e5f8654","d3a1e70795c38d7851b6e4f3b441c5ffdae171d6e2576a2204b7d79059aeea66","d7b8d41887c5fccfe19802c4336d34348b752abf0d98839575699d71deff60be","063fe3004728b8516a4d799ee16f9a71801ba24e0443dd98638cef1bd4353a7c","9bceae6cc1126db61cec2f87102d3f28d5e44e5ec6fe25464b50f24ea562c23c","fab7912fc3ff45fce2f5d5febc9494c4d0a85d6c63fff68f21e4669c32eaacb9","f6c3fcb9d75d8aea778236fd9327ceb935b41865dbf3beac698be77e0ae9018d","b20bc124abd8ee572d0d756713ff987b116cdae908a6fcbc40e80d4b999f56b4","a599f3f450ad62c3fdc0c3fd25cddcc9332ffb44327087947d48914a8da81364","645dff895168aa82350c9aa60aa0b3621b84289fef043be842f45a9c6c0ac6e2","f068ff5b7fb3bdc5380e0c677e21de829bd25cdac63a9b083fdc220fcb225280","09d2fdca6ea6c135897a26976ad3c0db724adaf23ef4e38ad852b1d8efef1ae6","15de5b7739bf7e40213a200853bf78455ee5958af08eda786605a54a7f25ade6","aa31b69fc0094a66e771e189d387ffed138b53b211903f96ca3737792f69abdf","37862e711637ebd927907a82cbf0143ea30e95eb165df554926c43936b1d77a9","89e253db2c2cc9a510c521f14dd2b1aae4de2556ee5159ad8d118d3587e3a880","3d0a172cee184a0f4111a7bd7fbb8729af3f54b30c06a2677d85c20ea9c811ab","d6a07e5e8dee6dc63c7ecd9c21756babf097e1537fbc91ddfec17328a063f65d","6fdc88b1287c276b55b7f7c4c7b49587813c763eea9751ce0baf0a7e61cd5d89","6a02443704052768bd021f24783aa104b02ae4444e9b735317bf13c6b857a11e","37987b0fe9800cf25473c882ce07bccdab2763c5681c1a2d16816aead46aa8d1","c84c03c721154068e1a60d83e9e85819bd3ef70b824ac2edc498aa31c06e5781","1d6a5e3af9fdd51e9670a940abd27c59d57c1a77635f6888bec0281af3bde9fe","c96fb6a0c1e879f95634ab0ff439cbb6fff6227b26bbf0153bef9ed0aabba60d","db936079fe6396aad9bf7ad0479ffc9220cec808a26a745baebb5f9e2ef9dbc7","06bc0b9cc7bf0b92534f1517fe5adde1f23f60cc6cc5c59f8e1c65db48a40067","919a753b0cbb12ccc606c62e2d34884d75a48ba19b1dda497c72621b11dac088","2c27e33ee0bf722988da00abd582cc9b806ce3fd9153a864800a339ad13f3fcf","92d7b3a5aa5dc872e54cbad2a7094b3ea4f72c7901de1d07b4c334ff658297f0","7a52922b38e9686d5bdc6e75774929eec6688d26c1dfe4a03ddec77ede468e87","aa5efca2833d89b55248f1889a6433dab1b1f41768e9a75f8ce35f9bf56c5ec4","f3cb934699bea498259de69c44a4f93b461f079d72cddb041587afd9312efb6e","006855ddea8674d084173a768f88519dc154be94eba5e2120262a33709832b9b","17dd843a266f99ca4b3a1257538bd1cc69dc5c7f2f23c3891f0430615b8c9c1c","5430364886c721a30475253356162b6c27871718094cb3e69e2bcea71a17e533","1218398da7c8dc4add10bdb3aa2856aad54b123d847eaf574d1d694ac269bfb5","07886b8104556bcc9314b90cd2043f2286e54c1f6ba2ebbc953e1e43232e12be","b637cd92688a6cdf4f8f184ff529dc2bc7f15692828e2c0c66a60e6972f400c7","7061e83d6792897077bcac039fccf7325234004769f591c63a8cf8478bf551bb","51a74c09c3d3fc62fcfefed0a193c3d6388e3e0f8a574bb9d5c5b7cdaa32453a","277a358d61376fce7ac3392402909c96cf6a0a613146549fc0165ccff953e012","50614c808e099a1d4413786f3783d9eeaaa74b267f2c87fcf8a893287e91c301","f4cb6530f248e87cefa74ef623206fec805f6252f885f8e14ef3d1a5872cef2d","38c332caadd8391566552395d592076470a5e7423f70964620eabf05c02907cd","eb17b5bf1fc763a644c21d76572c0e41e351c3f6dfcde649428d5d829f7294d2","cb124162c87b29ff5121e3ee5bb29c782f101e0135d6c2644ab1b31d530a435e","406d6f5d3707c488362fb40d1c1f8a7b0a42b70554b427160185d93e430228f5","2e9776410c5bc290d9432a9215c67398a273e514a79b9e15f32ecddfde8a03be","313ff8df074b81d3e4f088ff3a3a06df3d9b0d0c7f55469ccc2ac887ecb6b867","c718475bca06806cc243e77777641cb67ba68f2c57321a4773ebb47760a3bcf2","96e6bf811343caab5112b68880905c5d20d9257054afac6c18e718a4c549ed27","a2793bc73ba63ca7d259cb0f0b61d0023820170d08a1f9715006c8042d060165","d5011b38165771fdf75a9a06d6d379a1fc7edd7eb695ebdc52319fb6e3c6d81f","88417fb19d339304e9616a38ea513251047c9e300c81f9467fc317df8a582e71","3e8e2d132f726dddbda57819f5391504e585cb3beab6b32203064e7e40618583","6e23627cd3f10418b5b2db102fdcf557b75f2837f266d88afac6b18f333bb1bc","866046dcea88f23d766a65487ee7870c4cf8285a4c75407c80a5c26ed250ef8d","019f4f1cbc781cc15c6173f8be5ef907405722194ab297127b3c3426e5368339","41f4413eac08210dfc1b1cdb5891ad08b05c79f5038bdf8c06e4aedaa85b943d","c79f1c8b51d8475dde8d2973f740f43ca34b1f0a95d93649cd76c1ee20abba19","35f0d2bd2c5c05c0cb19095bf5b7c44365b1c88efe6285370855b90417277a64","8264b129f4c4eb4799703f8e5ee2223a184d1cdbfc782158b1f40a88a4435a1f","527ddda6f8be1279f3294714534c49d6e90f238cea325519882ebf88d7ec5bd2","b23877792e8bd00271d0ec5d401b68e4228540a4316de3d9dfb697b955c161a4","35b2eb1de01633db90d41abe93730b29984856fcc840b4c2801bfd3761a2097b","95f0c9127b879c2fc7e31f8e09ff45bb4aae302e60f4b9ceaf4d9ee6bc51ec66","2a6b4655a6edce9e07c7d826848f72533c9991d40bc36e3f85558ad20e87ce2d","6e3d29fdc96ebbb2ac672d2dae710c689c1ea0d0e9469e0847616f3c38fd085f","d505055b8fadd42da235c85947911d8d198ad70c5f5775991e7821d4f89c90f5","8b5a5852099dca7d7e7a7cef6d681dc1586aafacdb963ca180fe5cabbfa3a24b","0d1aa3341d1ad2064adada71c5d01a2f572e4aac09410e5616d90894105a0eb9","52494ca5a884da3bf11b8165ab31429715f0970d9c6383240c5666f4bd713e01","162fafa2291749df2ab4516854aa781fcee1d9fca2ecd85fb48ae794c0700ce2","b4b9b51ee6f6309cda2e539245235a8caeca2b1d6bf12b5e5c162d17333c450f","d2ffe8356f060b88c1c5cf1fa874a4b779fb87fd1977084876e8be9eab6bf485","c76053984b39150d00ade365b096a8bc21a4a7f2ee9e0a926711b00f8e7bf701","956b510767e3d6f362ea5800510635197723737af5d19ae07ee987ea4a90bfa5","cd1a8ff61f5063d7e6e2094e25d35c90b499961b63911f2f4ae0ff5555c2b4d7","1cf09b5945779e9bc75c4dcd805fb149c28fc90da3335186ef620647a3c540e1","9cdc0b9a313090ec45b34ea1eb02fbace433f509e753634b043e9b83038261e6","c93474cff0088351a65d3cad24037874a26a5371a48528563e56efe31cb3d8bb","b4580df8ea7f62d7b06588001952bf69426e6b03cf3d2569f5f608e45f29ba08","de27f7bb9be9d8a2b4557ec6503b8a315f74d598ce9a0ab81b5ed5610e1a8e81","fe3c378dcefa7ed8b21bd6822f5d7838b1119836da75ae1e1fb485d27b8ffb62","7365bf3333d4277b6fe374ed055624e5ec080dbb919e2d78f1cb75a3f1a4b4f6","a5fbf3bc5c16ab5c84465ba7a043a4bee4c2b20bd3633d50d80118a3844edbaf","0923e4ac8c894ad507bd2daee0df66b699de88467201381ece011ba5a080e1ff","e4f6626f827ea509255647e1b6db82145a2eb1a6b46202655e7d9bb19145c33b","26e23972c40f378f0301d8d7025ea895557c2865a1a31c8ea9c3fff0dbc27075","d2ae223bdab8337f040858fbf1ff3b6544ace8f679cc18a73f6d1c8d87113a94","795a08ae4e193f345073b49f68826ab6a9b280400b440906e4ec5c237ae777e6","8153df63cf65122809db17128e5918f59d6bb43a371b5218f4430c4585f64085","a8150bc382dd12ce58e00764d2366e1d59a590288ee3123af8a4a2cb4ef7f9df","5adfaf2f9f33957264ad199a186456a4676b2724ed700fc313ff945d03372169","d5c41a741cd408c34cb91f84468f70e9bda3dfeabf33251a61039b3cdb8b22d8","6e87c0c1cf06fe7dd6e545d72edefd61d86b4f13d2f9d34140e8168af94a7b7d","cbaf4a4aa8a8c02aa681c5870d5c69127974de29b7e01df570edec391a417959","b8d9df5c49858df86ffa6c497f1840528963c14ca0dea7684e813b008fe797b3","340a45cd77b41d8a6deda248167fa23d3dc67ec798d411bd282f7b3d555b1695","b1f8c85b27619ccfae9064e433b3b32a11d93d54de5a1afdaeca23c8b30e38a5","0ed6417b905cddb85f98281cb3b5b137d393955521993d9ce069d5e2d6b26ee8","f9ceab53f0d273ccaa68ef125974305dc26fe856af9a5be401ca72d0f78659d4","99d99a765426accf8133737843fb024a154dc6545fc0ffbba968a7c0b848959d","c782c5fd5fa5491c827ecade05c3af3351201dd1c7e77e06711c8029b7a9ee4d","883d2104e448bb351c49dd9689a7e8117b480b614b2622732655cef03021bf6d","8a10bdd9317aa91b37ee4b6dbd40529d0cd16353f04cf7c27b29c5604a28e8c3","09a7e04beb0547c43270b327c067c85a4e2154372417390731dfe092c4350998","eee530aaa93e9ec362e3941ee8355e2d073c7b21d88c2af4713e3d701dab8fef","ebf6ea6f412af15674333149f7f6561c0de9e36a4d4b350daccf6c5acbbf9fa3","1d6cc6dc76a777be3856c8892addb58d60b8957730951f9ab8b721e4f7fdf7e9","7a0e4cd92545ad03910fd019ae9838718643bd4dde39881c745f236914901dfa","c99ebd20316217e349004ee1a0bc74d32d041fb6864093f10f31984c737b8cad","6f622e7f054f5ab86258362ac0a64a2d6a27f1e88732d6f5f052f422e08a70e7","d62d2ef93ceeb41cf9dfab25989a1e5f9ca5160741aac7f1453c69a6c14c69be","1491e80d72873fc586605283f2d9056ee59b166333a769e64378240df130d1c9","c32c073d389cfaa3b3e562423e16c2e6d26b8edebbb7d73ccffff4aa66f2171d","eca72bf229eecadb63e758613c62fab13815879053539a22477d83a48a21cd73","633db46fd1765736409a4767bfc670861468dde60dbb9a501fba4c1b72f8644d","1f9cc8013b709369d82a9f19813cd09cd478481553a0e8262b3b7f28ab52b0b2","a314a39426700ba2b5a76c01bab321bbe79cfef898dae996e930b017fc2b0af9","7f2c10fc5de794bf7ddad2ff13b46e2b7f89ced296c1c372c5fdb94fc759d20d","6ea6e80bf94a93e4841d57878bba521822ca5e2ec7cbb626196a8efc2766eb79","8776e64e6165838ac152fa949456732755b0976d1867ae5534ce248f0ccd7f41","fdaf3475e11582e137bd84fa19f6bdbf23623f79cecc48a4037e8fa5756ba340","5c4c5b49bbb01828402bb04af1d71673b18852c11b7e95bfd5cf4c3d80d352c8","7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"ca72190df0eb9b09d4b600821c8c7b6c9747b75a1c700c4d57dc0bb72abc074c","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"bb65c6267c5d6676be61acbf6604cf0a4555ac4b505df58ac15c831fcbff4e3e","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","dab86d9604fe40854ef3c0a6f9e8948873dc3509213418e5e457f410fd11200f","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"d076fede3cb042e7b13fc29442aaa03a57806bc51e2b26a67a01fbc66a7c0c12","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","fd93cee2621ff42dabe57b7be402783fd1aa69ece755bcba1e0290547ae60513","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","223c37f62ce09a3d99e77498acdee7b2705a4ae14552fbdb4093600cd9164f3f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"4c50342e1b65d3bee2ed4ab18f84842d5724ad11083bd666d8705dc7a6079d80","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"8dbe725f8d237e70310977afcfa011629804d101ebaa0266cafda6b61ad72236","6b8861483f8d90261908256836f1b8951d1f4ac9a2a965e920fb18603c8d1d0a","72afd0094250e7f765576466170a299d0959a4799dbf28eb56ba70ca4772a8b4","44ec212fbf43580505de3d6054376ced252c534ced872c53698047387213efb9","4880c2a2caa941aff7f91f51948ebfb10f15283ff0b163f8ea2a74499add61aa","19c3760af3cbc9da99d5b7763b9e33aaf8d018bc2ed843287b7ff4343adf4634","9d1e38aeb76084848d2fcd39b458ec88246de028c0f3f448b304b15d764b23d2","b1048a866abac5d678376310d28fd258fd4d663942ac915a5fa90e585cf598f8","c9c6eed8faed23fc697b79d421ac443594a3458ae2a60150083ee1e860171971","9cc2a5c3e3c4be782a2300d356b94286764166acf2a6eedc83c6f7a53c0397f7","9ddf8e9069327faa75d20135cab675779844f66590249769c3d35dd2a38c2ba9","d7c30f0abfe9e197e376b016086cf66b2ffb84015139963f37301ed0da9d3d0d","ff75bba0148f07775bcb54bf4823421ed4ebdb751b3bf79cc003bd22e49d7d73","69196fa55fab9cd52c4eecba6051902bd5adff63ecf65e0546cb484b5a279fb1","35a9867207c488061fb4f6fe4715802fbc164b4400018d2fa0149ad02db9a61c","91bf47a209ad0eae090023c3ebc1165a491cf9758799368ffcbee8dbe7448f33","b75aa590b103f8491e1c943f9bc4989df55323d7e68fba393d3de11f4aae6bb8","4894a2c13e65af4fea49a2013e9123fe767a26ae51adb156e1a48dffba1e82f7","fc2a131847515b3dff2f0e835633d9a00a9d03ed59e690e27eec85b7b0522f92","90433c678bc26751eb7a5d54a2bb0a14be6f5717f69abb5f7a04afc75dce15a4","55ae9554811525f24818e19bdc8779fa99df434be7c03e5fc47fa441315f0226","7210df9e28cc71105d8938508a8bf99e7bf7df1f18548d774d7c2accbfb3332e","b842238362d1d1879242576ea63d436daa335613559ef0aff586825638d2d47a","e7bde95a05a0564ee1450bc9a53797b0ac7944bf24d87d6f645baca3aa60df48","62e68ce120914431a7d34232d3eca643a7ddd67584387936a5202ae1c4dd9a1b","e6b74c07c5a4e65b27f5a419467e021f61d45255d625bacffe502bd226ffc41d","e1cb8168c7e0bd4857a66558fe7fe6c66d08432a0a943c51bacdac83773d5745","70e929fee0f98d969cd4247583b4f70fe912787be58e21f6e9123b4afdaeb8f7","cd0eeda77ab149135d817ac1e1cd1e88f73bf37fe5a652b5c14e124e676201cf","cbc15ecf15b73c132087c185178ba51b7a786ff4a51b6f52a50b01aeb3d48353","8ca60a0840c741e66d4421defe62d44226167a4750fcfa080f760a8f9487fd1d","6d8dedbec739bc79642c1e96e9bfc0b83b25b104a0486aebf016fc7b85b39f48","cd0565ace87a2d7802bf4c20ea23a997c54e598b9eb89f9c75e69478c1f7a0b4","c18f4f72a68275b7602e5968b862cb9b7b76ea4a1ac1b3e622f99e0b672569e8","0fdb1ed509382bd388896d3770655b0cda8c80c36f8c54b3899992f7a3a8665c","d97b96b6ecd4ee03f9f1170722c825ef778430a6a0d7aab03b8929012bf773cd","f55fc3e536ab193aaabb9b6ded5f93181f81294ee65fe3199c9f4415f0f1e53c","ec8053ec564993a885ba2e2c31408369270a190a332a29fac7a825bb7e60b37c","542ecc66e4fcc33f46695ae22b1d14c075054a78c019915d556636be642465af","476b5c25e85b94e15d761bb9503f55fb11e81167df451f187f5080fca825273b","72636f59b635c378dc9ea5246b9b3517b1214e340e468e54cb80126353053b2e","ebb79f267a3bf2de5f8edc1995c5d31777b539935fab8b7d863e8efb06c8e9ea","ada033e6a4c7f4e147e6d76bb881069dc66750619f8cc2472d65beeec1100145","52ff5e1ea35c54428b46c75fd14f87b7a7158a8f4a1ecfc4a9b996a03185c738","605d29d619180fbec287d1701e8b1f51f2d16747ec308d20aba3e9a0dac43a0f","67c19848b442d77c767414084fc571ce118b08301c4ddff904889d318f3a3363","c704ff0e0cb86d1b791767a88af21dadfee259180720a14c12baee668d0eb8fb","195c50e15d5b3ea034e01fbdca6f8ad4b35ad47463805bb0360bdffd6fce3009","da665f00b6877ae4adb39cd548257f487a76e3d99e006a702a4f38b4b39431cb","0d276d377a0bf0f35e8d7a5b871922ebfa6aff1757d1bbe27a7982b15ce78516","9cbb45413acfdf0cc384d884de88c3f951319004450c88a2bcdad62a11bd21d9","d7a4309673b06223537bc9544b1a5fe9425628e1c8ab5605f3c5ebc27ecb8074","ced87f58b05e2b07e314754f0a7ab17e2df9c37ee2d429948024b2c6418d6c9f","3eadfd083d40777b403f4f4eecfa40f93876f2a01779157cc114b2565a7afb51","3ac0b94ba8f884f63d38450ce9e29ecd59ff00805ffdd609193d7532b8605459","a3684ea9719122f9477902acd08cd363a6f3cff6d493df89d4dc12fa58204e27","2828dabf17a6507d39ebcc58fef847e111dcf2d51b8e4ff0d32732c72be032b3","c0c46113b4cd5ec9e7cf56e6dbfb3930ef6cbba914c0883eeced396988ae8320","118ea3f4e7b9c12e92551be0766706f57a411b4f18a1b4762cfde3cd6d4f0a96","473bf3574a48185f71b70fe839fb1a340a176d80ea7f50dee489c2dc8e81613f","2b14b50de7e32a9882511d1b06be4eb036303bc72ce4a10f93a224382731500d","eeb24fa259f000f6b51a1fe89123f55de081eb2a0ef8d8f847afd67af49cfb68","91d8f3c1c3ae5efb8564ec7cb1f8ac8bf5714eb94078fb50a761ab811963e324","e21bb2cfbcdd8ce7eebb72422f3660806724f2b16cd6ce126d527511abb3a379","c04146836a55ea071b435298335e47f569db0e4d3ae420e35c83e448f944192f","31f71fe23daabea143fc8bd21dae0d5908227180fcda38ad3674df70351f9761","517168a194de5ffaf307e9f8d9eea05952997e795c2f21f8fbc37c64bc8c3872","6305acbe492b9882ec940f8f0c8e5d1e1395258852f99328efcb1cf1683ca817","7619b1f6087a4e9336b2c42bd784b05aa4a2204a364b60171e5a628f817a381e","15be9120572c9fbcd3c267bd93b4140354514c9e70734e6fcca65ff4a246f83a","412482ab85893cec1d6f26231359474d1f59f6339e2743c08da1b05fc1d12767","858e2315e58af0d28fcd7f141a2505aba6a76fd10378ba0ad169b0336fee33fc","02da6c1b34f4ae2120d70cf5f9268bf1aedf62e55529d34f5974f5a93655ce38","3ecf179ef1cc28f7f9b46c8d2e496d50b542c176e94ed0147bab147b4a961cd6","b145da03ce7e174af5ced2cbbd16e96d3d5c2212f9a90d3657b63a5650a73b7f","c7aadab66a2bc90eeb0ab145ca4daebcbc038e24359263de3b40e7b1c7affba6","99518dc06286877a7b716e0f22c1a72d3c62be42701324b49f27bcc03573efff","f4575fd196a7e33c7be9773a71bcc5fbe7182a2152be909f6b8e8e7ba2438f06","05cba5acd77a4384389b9c62739104b5a1693efd66e6abac6c5ffc53280ae777","acacda82ebd929fe2fe9e31a37f193fc8498a7393a1c31dc5ceb656e2b45b708","1b13e7c5c58ab894fe65b099b6d19bb8afae6d04252db1bf55fe6ba95a0af954","4355d326c3129e5853b56267903f294ad03e34cc28b75f96b80734882dedac80","37139a8d45342c05b6a5aa1698a2e8e882d6dca5fb9a77aa91f05ac04e92e70b","e37191297f1234d3ae54edbf174489f9a3091a05fe959724db36f8e58d21fb17","3fca8fb3aab1bc7abb9b1420f517e9012fdddcbe18803bea2dd48fad6c45e92e","d0b0779e0cac4809a9a3c764ba3bd68314de758765a8e3b9291fe1671bfeb8a1","d2116b5f989aa68e585ae261b9d6d836be6ed1be0b55b47336d9f3db34674e86","d79a227dd654be16d8006eac8b67212679d1df494dfe6da22ea0bd34a13e010c","b9c89b4a2435c171e0a9a56668f510a376cb7991eaecef08b619e6d484841735","b85baa660305c65d45f97f5b227b1505a8023955f1bf27da178232e7be99cc12","d5dd266b6f5c9c24f6b4001e172615626a51e350b3267b4af3970e4fb2c57fab","89049878a456b5e0870bb50289ea8ece28a2abd0255301a261fa8ab6a3e9a07d","a464510505f31a356e9833963d89ce39f37a098715fc2863e533255af4410525","ebbe6765a836bfa7f03181bc433c8984ca29626270ca1e240c009851222cb8a7","ac10457b51ee4a3173b7165c87c795eadd094e024f1d9f0b6f0c131126e3d903","b2f2311d7085a1feec3f6a85d7cc8bdaf1d976de1874c1f92940ad8ce6a34d39","954523d1f4856180cbf79b35bd754e14d3b2aea06c7efd71b254c745976086e9","4ee1e0fea72cd6a832c65af93b62fbf39b009e3711384bb371b48c9abba66781","d35fb65da678a4971822249d657f564ff6bdb6618428642235c4858ebafb2379","b27a613e49e00740db23e2e267b8e44e51ee85a448e787b7fa7c7a7be7316104","4d54136f3080a92f0b031115719321fa25bd855582c30f7f6b6e78969ffe7ec5","6c7554f14f08d3264e220f6ac82cf00e3b6a3bd15ec676bd97bf0e06da79e18d","a2506732a96c864f9336a4fc0403f7f4f3831cfe1db4a40ddf95866dbe2d28ef","8aa451aa2c6e762f359e6fae74e2903f6e3304b1a5ae19c1da548128ddf25add","2e756f5c2e33e9b28aebe174d147a19b46f2364027050acb8c8c2f83e005b2ec","434ea45c930ac3accf5951ac80af2da02a3e0945d33f1e59dbd3a50498cb519b","dc5f64a739746e51c220dceef9b4de820a1daa2dea3254d63bba9988ddcb500b","ab555ebf13e4f021233b5dbd6876eb2a4514aa651693ba9fa38d1e7e7df3b841","6b3233127e08357fda5142130d43a222ed0dac32861ac6c72f8288c0c79cf749","0d4dab75055c9279cb1dcb693cf8568bd724e4f653fd95a3a82ad2e267c4dda6","e4b29bf9f77857ac881ae8eb16d685ecc53e0a996f20d4ff762a6f2974474d90","df6c83e574308f6540c19e3409370482a7d8f448d56c65790b4ac0ab6f6fedd8","32f19b665839b1382b21afc41917cda47a56e744cd3df9986b13a72746d1c522","405fa7000efd4f0317eb31fa76ed40bad16be48ef2efc88b53bbe439fae74aaa","3e5a089877b3647b42c6f8d8284ff26e57fd3d94f1b1736080079796b994a89e","fde8122ba963e8f7ef9da2a35029632dc8637e9740c9d8cc9745d94ca42e6762","5a44788293f9165116c9c183be66cefef0dc5d718782a04847de53bf664f3cc1","afd653ae63ce07075b018ba5ce8f4e977b6055c81cc65998410b904b94003c0a","e113cc2ab6f65586cbba1618aab57af8f1e1fbe0ab9c3d339f1b348f6fe8f63c","9f96b9fd0362a7bfe6a3aa70baa883c47ae167469c904782c99ccc942f62f0dc","5df9a68835c1e020625127d8c951c90808d319c811fc3a780d24f64053192ea4","71807b208e5f15feffb3ff530bec5b46b1217af0d8cc96dde00d549353bcb864","67f7637f370ee8c18fe060c901e071db2c4368de90a5c58cf1f959d12b0c2f7e","eaf8514ce110fa428a93a27408df4d06d133dbd9ed0a775c315ddfdd507853a9","260f889b9e2b69f77be1155348eb345166aec664b3efff6720053c6844a41f28","319f8e45e370ba3d33f0887e3046096714959d3764fc68b444885cfdb9c101dd","e9cba458ea179833bba7b180c10e7293b4986d2f66a7bd99c13f243d91bab3d4","8b0b6a4c032a56d5651f7dd02ba3f05fbfe4131c4095093633cda3cae0991972","27484cb3aa328bc5d0957fcb34df68a5db1be280af510d9ed3a282b1a0a93b38","6c2b8c78eb1476ad2668898923fda9c3e67b295b9a6dc7a7312ead2582a76883","d8fb0821bcebbcc5ef87655a6442e8909313eb0bd7960f696b10cdb31576fdaa","1053398d8fd9b1a45170b5cca30bd54abe7ec7061ef2929c4da9feaa71737930","83f7f1890b6a202865b1014b5e72b2115f522773304d61569396be144bbee2fc","8949f85fb38104d50011076ac359186889d6e18e230b0cf8256230e802e8c4ed","fe4613c6c0d23edc04cd8585bdd86bc7337dc6265fb52037d11ca19eeb5e5aaf","667f0c535a93ce1f70d528b57a5c4bf2af8f60559795f39399c8958ede1b66a7","0f02f73e940e993a73103717e21e1d74166b83093bcb299d5e2b5c8bdc684c9b","31a335eb49c1ea1b0d8ded51d2dee99d96b45e67f581638b2bce9cd121a2dcdc","c86ad86cc7a3ec3794deab9b943a823d9aaf09b846bb581a06bf263117e8d6d9","cfe88132f67aa055a3f49d59b01585fa8d890f5a66a0a13bb71973d57573eee7","f23601713615719b1a1394deae884fb9f507de819a086d5a019c63793da9efc6","50fd11b764194f06977c162c37e5a70bcf0d3579bf82dd4de4eee3ac68d0f82f","ad5ad568f2f537a43dcc1588b2379f9dc79539ae36b8821b13a5d03625211eb2","99579aa074ed298e7a3d6a47e68f0cd099e92411212d5081ce88344a5b1b528d","d2d58166965f631fa203f405f3713b0f86f1f8b80755e9daea43057a25311e16","ce7dbf31739cc7bca35ca50e4f0cbd75cd31fd6c05c66841f8748e225dc73aaf","942ab34f62ac3f3d20014615b6442b6dc51815e30a878ebc390dd70e0dec63bf","a861cceeb708d23beebcf7f3235dcdd1a5a7d1655afd6ba49dbc0d45f5370469","0256d60785ede7860b5262f504f139aa68f74db44ba9f03807b752864580772c","396c1e5a39706999ec8cc582916e05fcb4f901631d2c192c1292e95089a494d9","89df75d28f34fc698fe261f9489125b4e5828fbd62d863bbe93373d3ed995056","7cb9b6d5c1e3508fbc81e7bbab314eac54715f9326ac72fd0eb65f17a4393d50","eefa4f00b4a4c150786e5ed866999b44687388e94a99f0b67a78b59c5b2303fd","be75c12a8d61aaadb9e33e0d7d0e7b2f3bee9a3ac618d04367e0b7c2aea3f86d","e6223b7263dd7a49f4691bf8df2b1e69f764fb46972937e6f9b28538d050b1ba","bf6599adc97713bc0eefb924accc7cb92c4415718650166fcf6157a1ef024f01","1db014db736a09668e0c0576585174dbcfd6471bb5e2d79f151a241e0d18d66b","98fca44eb9a677e5bd6eafaa95eeefbe719c3d520edc819c5d8186dcd7971163","56a2cc03b33542972ed37df7153319540238d34a3a688a004cffcb90c84b3138","82d3e00d56a71fc169f3cf9ec5f5ffcc92f6c0e67d4dfc130dafe9f1886d5515","9a388a54fbab04eef88430f5775cc48c1069d14e852d6fdb10cc966a9c3cd8e8","7007c800fbb767a1137e011d7d8fe0847cbd1a9e99bbe3528db955e32a32d6c1","e3d221660c0b79a9a3ba1111b3dfbb1136c0b52d7609b0054d3ce09ce711a3e6","892adfd3427fa4ed24bede88e8e46e4cb67e53e794365023fd473f3be796981d","b4f1cc43cdf2f75f62ea43ab32ac29e26649920906712d9605cef4849f48065b","9fac6ebf3c60ced53dd21def30a679ec225fc3ff4b8d66b86326c285a4eebb5a","992fda06eebba15d37625007500bef5b3fdd1c5e2f5a334064efeb1604c7bce3","07bc8a3551e39e70c38e7293b1a09916867d728043e352b119f951742cb91624","e47adc2176f43c617c0ab47f2d9b2bb1706d9e0669bf349a30c3fe09ddd63261","7fec79dfd7319fec7456b1b53134edb54c411ba493a0aef350eee75a4f223eeb","189c489705bb96a308dcde9b3336011d08bfbca568bcaf5d5d55c05468e9de7a","98f4b1074567341764b580bf14c5aabe82a4390d11553780814f7e932970a6f7","abdc0a8843b28c3cafbefb90079690b17b7b4e2a9c9bbf2cd8762e11a3958034","2e252235037a2cd8feebfbf74aa460f783e5d423895d13f29a934d7655a1f8be","f3e04e6c6db44b9ad05a0b7c89e914b08eee05f2050968b761ed98735d42cd62","e25d9bd8f80b6ffbcc8826ed1b407e747e4fbe346c5bab62cbe5837da4eeb189","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":1,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./src/server/dist","removeComments":true,"rootDir":"./src/src/server","skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":false,"target":4},"fileIdsList":[[324],[324,357,359],[324,350,359,360],[324,389],[246,324,389],[324,390,391],[48,324,361,392,394,395],[242,324,350],[324,393],[324,350,357,358],[324,358,359],[324,350],[258,324,337],[324,453],[324,362,363,364,365,366,367,368,369,370,371,372,373,374,375],[251,324,337],[258,324],[248,324,350,453],[324,380,381,382,383,384,385,386,387],[253,324],[324,350,453],[324,376,379,388],[324,377,378],[324,341],[253,254,255,256,324],[324,397],[324,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418],[324,421],[312,324,331,420],[47,257,324,350,357,389,396,419,422,443,448,450,452],[52,324],[52,242,324],[251,324,424],[245,324,426],[242,246,324],[52,324,350],[250,251,324],[263,324],[265,266,267,268,269,324],[257,258,271,275,324],[276,277,324,332],[324,331],[49,50,51,52,53,243,244,245,246,247,248,249,250,251,252,258,263,264,270,275,324,333,334,335,337,345,346,347,348,349],[274,324],[259,260,261,262,324],[251,259,260,324],[251,257,258,324],[251,261,324],[251,324,341],[324,336,338,339,340,341,342,343,344],[49,251,324],[324,337],[49,251,324,336,340,342],[260,324],[324,338],[251,324,337,338,339],[273,324],[251,255,273,324,345],[271,272,274,324],[247,249,258,264,271,276,324,346,347,350],[53,247,249,252,324,346,347],[256,324],[242,324],[273,324,350,351,355],[324,355,356],[324,350,351],[324,350,351,352],[324,352,353],[324,352,353,354],[252,324],[324,436],[324,436,437,438,439,440,441],[324,428,436],[324,436,437,438,439,440],[252,324,436,439],[324,423,429,430,431,432,433,434,435,442],[252,324,350,429],[252,324,428],[252,324,428,453],[245,251,252,324,424,425,426,427,428],[242,324,350,424,425,444],[324,350,424],[324,446],[324,389,444],[324,444,445,447],[273,324,449],[324,336],[257,324,350],[324,451],[271,275,324,350,453],[324,457],[324,350,453,468,469],[324,461,467,468],[324,472,473],[324,453,458,475],[324,476],[324,468],[324,475,478],[47,324,458,470,471,474,477,479,482,487,490,491,492,494,496,502,504],[324,350,453,463,464,467,468],[324,350,459],[251,324,334,453,459,460,461,467,468,470,505],[324,461,462,466,468,481,486],[324,350,453,467,468],[324,480],[324,462,467,468],[324,453,462,463,467],[324,350,453,467],[324,453,460,461,466,483,484,485],[324,350,453,462,463,464,465,467,468],[251,324,453],[324,350,462,466,468],[324,467],[324,334],[263,324,350,488],[324,489],[324,350,462],[271,324,350,453,458,462,470,491],[274,275,324,453,457,493],[324,495],[311,324,331,453],[324,498,500,501],[324,497],[324,499],[324,453,461,467,498],[51,251,324,334,350,453,462,467,470,482],[324,503],[278,324],[281,324],[282,287,315,324],[283,294,295,302,312,323,324],[283,284,294,302,324],[285,324],[286,287,295,303,324],[287,312,320,324],[288,290,294,302,324],[289,324],[290,291,324],[294,324],[292,294,324],[294,295,296,312,323,324],[294,295,296,309,312,315,324],[324,328],[290,297,302,312,323,324],[294,295,297,298,302,312,320,323,324],[297,299,312,320,323,324],[278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330],[294,300,324],[301,323,324],[290,294,302,312,324],[303,324],[304,324],[281,305,324],[306,322,324,328],[307,324],[308,324],[294,309,310,324],[309,311,324,326],[282,294,312,313,314,315,324],[282,312,314,324],[312,313,324],[315,324],[316,324],[294,318,319,324],[318,319,324],[287,302,312,320,324],[321,324],[302,322,324],[282,297,308,323,324],[287,324],[312,324,325],[324,326],[324,327],[282,287,294,296,305,312,323,324,326,328],[312,324,329],[294,312,324,331],[54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,173,174,175,177,186,188,189,190,191,192,193,195,196,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,324],[99,324],[55,58,324],[57,324],[57,58,324],[54,55,56,58,324],[55,57,58,215,324],[58,324],[54,57,99,324],[57,58,215,324],[57,223,324],[55,57,58,324],[67,324],[90,324],[111,324],[57,58,99,324],[58,106,324],[57,58,99,117,324],[57,58,117,324],[58,158,324],[58,99,324],[54,58,176,324],[54,58,177,324],[199,324],[183,185,324],[194,324],[183,324],[54,58,176,183,184,324],[176,177,185,324],[197,324],[54,58,183,184,185,324],[56,57,58,324],[54,58,324],[55,57,177,178,179,180,324],[99,177,178,179,180,324],[177,179,324],[57,178,179,181,182,186,324],[54,57,324],[58,201,324],[59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,324],[187,324],[324,453,454],[324,453,454,455],[324,456,505]],"referencedMap":[[48,1],[360,2],[361,3],[390,4],[391,5],[392,6],[396,7],[393,8],[394,9],[358,1],[359,10],[395,11],[374,1],[362,1],[363,12],[364,13],[365,1],[366,14],[376,15],[367,1],[368,16],[369,1],[370,1],[371,12],[372,12],[373,12],[375,17],[383,18],[385,1],[382,1],[388,19],[386,1],[384,1],[380,20],[381,21],[387,1],[389,22],[377,1],[379,23],[378,24],[254,1],[257,25],[253,1],[255,1],[256,1],[413,26],[398,26],[405,26],[402,26],[415,26],[406,26],[412,26],[397,1],[416,26],[419,27],[410,26],[400,26],[418,26],[403,26],[401,26],[411,26],[407,26],[417,26],[404,26],[414,26],[399,26],[409,26],[408,26],[422,28],[421,29],[420,1],[453,30],[49,1],[50,1],[51,1],[53,31],[243,32],[244,31],[424,1],[271,1],[272,1],[425,33],[245,1],[426,1],[427,34],[52,1],[247,35],[248,1],[246,36],[249,35],[250,1],[252,37],[264,38],[265,1],[270,39],[266,1],[267,1],[268,1],[269,1],[276,40],[333,41],[277,1],[332,42],[350,43],[334,1],[335,1],[493,44],[263,45],[261,46],[259,47],[260,48],[262,1],[342,49],[336,1],[345,50],[338,51],[343,52],[341,53],[344,54],[339,55],[340,56],[274,57],[346,58],[275,59],[348,60],[349,61],[337,1],[251,1],[258,62],[347,63],[356,64],[351,1],[357,65],[352,66],[353,67],[354,68],[355,69],[423,70],[437,71],[436,1],[442,72],[438,71],[439,73],[441,74],[440,75],[443,76],[430,77],[431,78],[434,79],[433,79],[432,78],[435,78],[429,80],[445,81],[444,82],[447,83],[446,84],[448,85],[449,57],[450,86],[273,1],[451,87],[428,88],[452,89],[457,90],[458,91],[470,92],[471,1],[472,1],[473,93],[474,94],[476,95],[477,96],[478,97],[475,91],[479,98],[505,99],[465,100],[460,101],[462,102],[487,103],[463,104],[481,105],[480,1],[464,106],[484,107],[468,108],[485,1],[486,109],[466,110],[459,111],[467,112],[461,113],[482,114],[489,115],[490,116],[488,117],[491,110],[492,118],[494,119],[496,120],[495,121],[502,122],[469,14],[498,123],[497,14],[500,124],[499,1],[501,125],[483,126],[504,127],[503,14],[278,128],[279,128],[281,129],[282,130],[283,131],[284,132],[285,133],[286,134],[287,135],[288,136],[289,137],[290,138],[291,138],[293,139],[292,140],[294,139],[295,141],[296,142],[280,143],[330,1],[297,144],[298,145],[299,146],[331,147],[300,148],[301,149],[302,150],[303,151],[304,152],[305,153],[306,154],[307,155],[308,156],[309,157],[310,157],[311,158],[312,159],[314,160],[313,161],[315,162],[316,163],[317,1],[318,164],[319,165],[320,166],[321,167],[322,168],[323,169],[324,170],[325,171],[326,172],[327,173],[328,174],[329,175],[507,176],[47,1],[242,177],[215,1],[193,178],[191,178],[241,179],[206,180],[205,180],[106,181],[57,182],[213,181],[214,181],[216,183],[217,181],[218,184],[117,185],[219,181],[190,181],[220,181],[221,186],[222,181],[223,180],[224,187],[225,181],[226,181],[227,181],[228,181],[229,180],[230,181],[231,181],[232,181],[233,181],[234,188],[235,181],[236,181],[237,181],[238,181],[239,181],[56,179],[59,184],[60,184],[61,184],[62,184],[63,184],[64,184],[65,184],[66,181],[68,189],[69,184],[67,184],[70,184],[71,184],[72,184],[73,184],[74,184],[75,184],[76,181],[77,184],[78,184],[79,184],[80,184],[81,184],[82,181],[83,184],[84,184],[85,184],[86,184],[87,184],[88,184],[89,181],[91,190],[90,184],[92,184],[93,184],[94,184],[95,184],[96,188],[97,181],[98,181],[112,191],[100,192],[101,184],[102,184],[103,181],[104,184],[105,184],[107,193],[108,184],[109,184],[110,184],[111,184],[113,184],[114,184],[115,184],[116,184],[118,194],[119,184],[120,184],[121,184],[122,181],[123,184],[124,195],[125,195],[126,195],[127,181],[128,184],[129,184],[130,184],[135,184],[131,184],[132,181],[133,184],[134,181],[136,184],[137,184],[138,184],[139,184],[140,184],[141,184],[142,181],[143,184],[144,184],[145,184],[146,184],[147,184],[148,184],[149,184],[150,184],[151,184],[152,184],[153,184],[154,184],[155,184],[156,184],[157,184],[158,184],[159,196],[160,184],[161,184],[162,184],[163,184],[164,184],[165,184],[166,181],[167,181],[168,181],[169,181],[170,181],[171,184],[172,184],[173,184],[174,184],[192,197],[240,181],[177,198],[176,199],[200,200],[199,201],[195,202],[194,201],[196,203],[185,204],[183,205],[198,206],[197,203],[184,1],[186,207],[99,208],[55,209],[54,184],[189,1],[181,210],[182,211],[179,1],[180,212],[178,184],[187,213],[58,214],[207,1],[208,1],[201,1],[204,180],[203,1],[209,1],[210,1],[202,215],[211,1],[212,1],[175,216],[188,217],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[46,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[455,218],[456,219],[454,14],[506,220]],"exportedModulesMap":[[48,1],[360,2],[361,3],[390,4],[391,5],[392,6],[396,7],[393,8],[394,9],[358,1],[359,10],[395,11],[374,1],[362,1],[363,12],[364,13],[365,1],[366,14],[376,15],[367,1],[368,16],[369,1],[370,1],[371,12],[372,12],[373,12],[375,17],[383,18],[385,1],[382,1],[388,19],[386,1],[384,1],[380,20],[381,21],[387,1],[389,22],[377,1],[379,23],[378,24],[254,1],[257,25],[253,1],[255,1],[256,1],[413,26],[398,26],[405,26],[402,26],[415,26],[406,26],[412,26],[397,1],[416,26],[419,27],[410,26],[400,26],[418,26],[403,26],[401,26],[411,26],[407,26],[417,26],[404,26],[414,26],[399,26],[409,26],[408,26],[422,28],[421,29],[420,1],[453,30],[49,1],[50,1],[51,1],[53,31],[243,32],[244,31],[424,1],[271,1],[272,1],[425,33],[245,1],[426,1],[427,34],[52,1],[247,35],[248,1],[246,36],[249,35],[250,1],[252,37],[264,38],[265,1],[270,39],[266,1],[267,1],[268,1],[269,1],[276,40],[333,41],[277,1],[332,42],[350,43],[334,1],[335,1],[493,44],[263,45],[261,46],[259,47],[260,48],[262,1],[342,49],[336,1],[345,50],[338,51],[343,52],[341,53],[344,54],[339,55],[340,56],[274,57],[346,58],[275,59],[348,60],[349,61],[337,1],[251,1],[258,62],[347,63],[356,64],[351,1],[357,65],[352,66],[353,67],[354,68],[355,69],[423,70],[437,71],[436,1],[442,72],[438,71],[439,73],[441,74],[440,75],[443,76],[430,77],[431,78],[434,79],[433,79],[432,78],[435,78],[429,80],[445,81],[444,82],[447,83],[446,84],[448,85],[449,57],[450,86],[273,1],[451,87],[428,88],[452,89],[457,90],[458,91],[470,92],[471,1],[472,1],[473,93],[474,94],[476,95],[477,96],[478,97],[475,91],[479,98],[505,99],[465,100],[460,101],[462,102],[487,103],[463,104],[481,105],[480,1],[464,106],[484,107],[468,108],[485,1],[486,109],[466,110],[459,111],[467,112],[461,113],[482,114],[489,115],[490,116],[488,117],[491,110],[492,118],[494,119],[496,120],[495,121],[502,122],[469,14],[498,123],[497,14],[500,124],[499,1],[501,125],[483,126],[504,127],[503,14],[278,128],[279,128],[281,129],[282,130],[283,131],[284,132],[285,133],[286,134],[287,135],[288,136],[289,137],[290,138],[291,138],[293,139],[292,140],[294,139],[295,141],[296,142],[280,143],[330,1],[297,144],[298,145],[299,146],[331,147],[300,148],[301,149],[302,150],[303,151],[304,152],[305,153],[306,154],[307,155],[308,156],[309,157],[310,157],[311,158],[312,159],[314,160],[313,161],[315,162],[316,163],[317,1],[318,164],[319,165],[320,166],[321,167],[322,168],[323,169],[324,170],[325,171],[326,172],[327,173],[328,174],[329,175],[507,176],[47,1],[242,177],[215,1],[193,178],[191,178],[241,179],[206,180],[205,180],[106,181],[57,182],[213,181],[214,181],[216,183],[217,181],[218,184],[117,185],[219,181],[190,181],[220,181],[221,186],[222,181],[223,180],[224,187],[225,181],[226,181],[227,181],[228,181],[229,180],[230,181],[231,181],[232,181],[233,181],[234,188],[235,181],[236,181],[237,181],[238,181],[239,181],[56,179],[59,184],[60,184],[61,184],[62,184],[63,184],[64,184],[65,184],[66,181],[68,189],[69,184],[67,184],[70,184],[71,184],[72,184],[73,184],[74,184],[75,184],[76,181],[77,184],[78,184],[79,184],[80,184],[81,184],[82,181],[83,184],[84,184],[85,184],[86,184],[87,184],[88,184],[89,181],[91,190],[90,184],[92,184],[93,184],[94,184],[95,184],[96,188],[97,181],[98,181],[112,191],[100,192],[101,184],[102,184],[103,181],[104,184],[105,184],[107,193],[108,184],[109,184],[110,184],[111,184],[113,184],[114,184],[115,184],[116,184],[118,194],[119,184],[120,184],[121,184],[122,181],[123,184],[124,195],[125,195],[126,195],[127,181],[128,184],[129,184],[130,184],[135,184],[131,184],[132,181],[133,184],[134,181],[136,184],[137,184],[138,184],[139,184],[140,184],[141,184],[142,181],[143,184],[144,184],[145,184],[146,184],[147,184],[148,184],[149,184],[150,184],[151,184],[152,184],[153,184],[154,184],[155,184],[156,184],[157,184],[158,184],[159,196],[160,184],[161,184],[162,184],[163,184],[164,184],[165,184],[166,181],[167,181],[168,181],[169,181],[170,181],[171,184],[172,184],[173,184],[174,184],[192,197],[240,181],[177,198],[176,199],[200,200],[199,201],[195,202],[194,201],[196,203],[185,204],[183,205],[198,206],[197,203],[184,1],[186,207],[99,208],[55,209],[54,184],[189,1],[181,210],[182,211],[179,1],[180,212],[178,184],[187,213],[58,214],[207,1],[208,1],[201,1],[204,180],[203,1],[209,1],[210,1],[202,215],[211,1],[212,1],[175,216],[188,217],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[46,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[455,218],[456,219],[454,14],[506,220]]},"version":"4.9.4"} \ No newline at end of file From e7b67e2119aeab4286dd159acfe7c2baa546c64c Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 18:14:56 +0200 Subject: [PATCH 06/78] add preinstall script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 1582678..65ad9b6 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "vue": "^2.6.14" }, "scripts": { + "preinstall": "npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", "installDependecies": "npm --prefix src/client install && npm --prefix src/api install", "start": "npm run --prefix src/client build && npm run --prefix src/api start" }, From 3f0f7577dc700dbf60827d14c56a10ebd52644b0 Mon Sep 17 00:00:00 2001 From: Ivan Labiak <71697480+ILabiak@users.noreply.github.com> Date: Tue, 10 Jan 2023 18:20:16 +0200 Subject: [PATCH 07/78] upd script (doesn't work on windows) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65ad9b6..1239398 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "vue": "^2.6.14" }, "scripts": { - "preinstall": "npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", + "preinstall": "sudo npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", "installDependecies": "npm --prefix src/client install && npm --prefix src/api install", "start": "npm run --prefix src/client build && npm run --prefix src/api start" }, From 062af458cb3a0ae7475ab55baa79cc4dc8ac00da Mon Sep 17 00:00:00 2001 From: water-korra Date: Tue, 10 Jan 2023 20:25:44 +0200 Subject: [PATCH 08/78] added service, controller and module for actions with recipes --- example.env | 2 - src/server/app.module.ts | 22 +++++++--- src/server/main.ts | 30 +++++++++++--- src/server/recipes/recipe.controller.ts | 38 +++++++++++++++++ src/server/recipes/recipe.dto.ts | 8 ++++ src/server/recipes/recipe.module.ts | 10 +++++ src/server/recipes/recipe.service.ts | 55 +++++++++++++++++++++++++ 7 files changed, 153 insertions(+), 12 deletions(-) delete mode 100644 example.env create mode 100644 src/server/recipes/recipe.controller.ts create mode 100644 src/server/recipes/recipe.dto.ts create mode 100644 src/server/recipes/recipe.module.ts create mode 100644 src/server/recipes/recipe.service.ts diff --git a/example.env b/example.env deleted file mode 100644 index abfe194..0000000 --- a/example.env +++ /dev/null @@ -1,2 +0,0 @@ -# DATABASE_URL="postgresql://username:password@localhost:5432/database?schema=public" -DATABASE_URL="postgresql://postgres:qwerty334455@6.tcp.eu.ngrok.io:17635/cyberchef?schema=public" \ No newline at end of file diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 4f49308..a2bb977 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -1,10 +1,22 @@ -import { Module } from '@nestjs/common'; -import { UserController } from './user.controller'; +// import { Module } from '@nestjs/common'; +// import { UserController } from './user.controller'; +// import { PrismaService } from './prisma.service' + +// @Module({ +// imports: [], +// controllers: [UserController], +// providers: [PrismaService], +// }) +// export class AppModule {} + + + + +import {Module} from "@nestjs/common"; +import { RecipeModule } from './recipes/recipe.module'; import { PrismaService } from './prisma.service' @Module({ - imports: [], - controllers: [UserController], - providers: [PrismaService], + imports: [RecipeModule], }) export class AppModule {} diff --git a/src/server/main.ts b/src/server/main.ts index acf994f..9fa9b6f 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -1,10 +1,30 @@ +// import { NestFactory } from '@nestjs/core'; +// import { AppModule } from './app.module'; +// import * as dotenv from 'dotenv' +// dotenv.config() + +// async function bootstrap() { +// const app = await NestFactory.create(AppModule); +// await app.listen(3000); +// } +// bootstrap(); + + import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import * as Process from 'process'; import * as dotenv from 'dotenv' dotenv.config() -async function bootstrap() { - const app = await NestFactory.create(AppModule); - await app.listen(3000); -} -bootstrap(); +const start = async () => { + try { + const PORT = Process.env.PORT || 5001; + const app = await NestFactory.create(AppModule); + // app.enableCors(); + await app.listen(PORT, () => console.log(`server started on PORT ${PORT}`)); + } catch (e) { + console.log(e); + } +}; + +start(); diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts new file mode 100644 index 0000000..37d4001 --- /dev/null +++ b/src/server/recipes/recipe.controller.ts @@ -0,0 +1,38 @@ +import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/common"; +import { CreateRecipeDto } from "./recipe.dto"; +import { RecipeService } from "./recipe.service"; + +@Controller("/api") +export class RecipeController { + constructor(private recipeService : RecipeService) {} + @Post('/recipes') + addRecipe(@Body() dto: CreateRecipeDto) { + console.log(dto); + + return this.recipeService.addRecipe(dto); + } + + @Get('/recipes/allrecipes') + getAllRecipes() { + return this.recipeService.getAllRecipes() + } + + @Get('/recipes') + getRecipeByName(@Query('recipeName') recipeName : string) { + return this.recipeService.getRecipeByName(recipeName) + } + + @Get('/user/recipes') + getRecipeById(@Query('recipeId') recipeId : number) { + return this.recipeService.getRecipeById(recipeId) + } + + // @Post('/user/recipes') + // addFavRecipe(@Body()) {} + + getFavRecipes() {} + + deleteFavRecipe() {} +} + + diff --git a/src/server/recipes/recipe.dto.ts b/src/server/recipes/recipe.dto.ts new file mode 100644 index 0000000..91d13a2 --- /dev/null +++ b/src/server/recipes/recipe.dto.ts @@ -0,0 +1,8 @@ +export class CreateRecipeDto { + readonly name; + readonly category_id; + readonly products; + readonly desription; + readonly image_link + } + \ No newline at end of file diff --git a/src/server/recipes/recipe.module.ts b/src/server/recipes/recipe.module.ts new file mode 100644 index 0000000..9607b57 --- /dev/null +++ b/src/server/recipes/recipe.module.ts @@ -0,0 +1,10 @@ +import {Module} from "@nestjs/common"; +import { RecipeController } from './recipe.controller'; +import { RecipeService } from './recipe.service'; + +@Module({ + controllers: [RecipeController], + providers: [RecipeService] +}) + +export class RecipeModule {} diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts new file mode 100644 index 0000000..5803dde --- /dev/null +++ b/src/server/recipes/recipe.service.ts @@ -0,0 +1,55 @@ +import { RecipeModule } from './recipe.module'; +import {Injectable} from '@nestjs/common'; +import { CreateRecipeDto } from './recipe.dto'; + +import { PrismaService } from '.././prisma.service'; +import { recipes as RecipeModel, Prisma } from '@prisma/client'; +import { RecipeRepository } from '../../database/repositories/recipe'; + + +const prisma = new PrismaService(); +const recipe = new RecipeRepository(prisma); + +@Injectable() +export class RecipeService { + async addRecipe (dto : CreateRecipeDto ) { + // return `kolya : ${dto.name}, products : ${dto.products}` + const newRecipe = await recipe.add(dto) + return newRecipe + + } + + async getRecipeById (id) { + const recipeById = await recipe.find(id) + return recipeById + + } + + async getAllRecipes () { + const recipes = await recipe.findAll() + return recipes + + } + + async getRecipeByName(recipeName) { + const recipeByName = await recipe.search(recipeName) + return recipeByName + } + + async addFavRecipe () { + + + } + + async getFavRecipes () { + + + } + + async deleteFavRecipe () { + + + } + +} + From 3a5ae6ba08fb44fcb18f9b01d10bf82e8653d8f5 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 00:00:46 +0200 Subject: [PATCH 09/78] user registration, auth module added. --- .gitignore | 2 ++ src/server/app.module.ts | 3 ++- src/server/auth/auth.controller.ts | 0 src/server/auth/auth.module.ts | 9 +++++++ src/server/auth/auth.service.ts | 17 ++++++++++++ src/server/recipes/recipe.service.ts | 19 +------------- src/server/user.controller.ts | 28 -------------------- src/server/user/dto/createUser.dto.ts | 5 ++++ src/server/user/user.controller.ts | 37 +++++++++++++++++++++++++++ src/server/user/user.module.ts | 10 ++++++++ src/server/user/user.service.ts | 24 +++++++++++++++++ 11 files changed, 107 insertions(+), 47 deletions(-) create mode 100644 src/server/auth/auth.controller.ts create mode 100644 src/server/auth/auth.module.ts create mode 100644 src/server/auth/auth.service.ts delete mode 100644 src/server/user.controller.ts create mode 100644 src/server/user/dto/createUser.dto.ts create mode 100644 src/server/user/user.controller.ts create mode 100644 src/server/user/user.module.ts create mode 100644 src/server/user/user.service.ts diff --git a/.gitignore b/.gitignore index ec8a1ac..2347d50 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ src/api/package.json .env src/database/prisma/migrations src/server/dist +src/.env + diff --git a/src/server/app.module.ts b/src/server/app.module.ts index a2bb977..68950d4 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -15,8 +15,9 @@ import {Module} from "@nestjs/common"; import { RecipeModule } from './recipes/recipe.module'; import { PrismaService } from './prisma.service' +import { UserModule } from "user/user.module"; @Module({ - imports: [RecipeModule], + imports: [RecipeModule,UserModule], }) export class AppModule {} diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts new file mode 100644 index 0000000..1e7a97b --- /dev/null +++ b/src/server/auth/auth.module.ts @@ -0,0 +1,9 @@ +import { UserModule } from './../user/user.module'; +import { Module } from "@nestjs/common"; +import {AuthService} from './auth.service' + +@Module({ + imports: [UserModule], + providers: [AuthService] +}) +export class AuthModule{} \ No newline at end of file diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts new file mode 100644 index 0000000..cf8387c --- /dev/null +++ b/src/server/auth/auth.service.ts @@ -0,0 +1,17 @@ +import { UserService } from './../user/user.service'; +import { Injectable } from "@nestjs/common"; +import { StringLiteralType } from 'typescript'; + +@Injectable() +export class AuthService{ + constructor(private userService: UserService) {} + + async validateUser(username : string, password: string): Promise { + const user = await this.userService.findUser(username) + + if(user && user.password === password ) { + return user + } + + } +} \ No newline at end of file diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 5803dde..9d65771 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -3,7 +3,7 @@ import {Injectable} from '@nestjs/common'; import { CreateRecipeDto } from './recipe.dto'; import { PrismaService } from '.././prisma.service'; -import { recipes as RecipeModel, Prisma } from '@prisma/client'; +// import { recipes as RecipeModel, Prisma } from '@prisma/client'; import { RecipeRepository } from '../../database/repositories/recipe'; @@ -13,7 +13,6 @@ const recipe = new RecipeRepository(prisma); @Injectable() export class RecipeService { async addRecipe (dto : CreateRecipeDto ) { - // return `kolya : ${dto.name}, products : ${dto.products}` const newRecipe = await recipe.add(dto) return newRecipe @@ -35,21 +34,5 @@ export class RecipeService { const recipeByName = await recipe.search(recipeName) return recipeByName } - - async addFavRecipe () { - - - } - - async getFavRecipes () { - - - } - - async deleteFavRecipe () { - - - } - } diff --git a/src/server/user.controller.ts b/src/server/user.controller.ts deleted file mode 100644 index 1094043..0000000 --- a/src/server/user.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { - Controller, - Get, - Param, - Post, - Body, - Put, - Delete, - Query, -} from '@nestjs/common'; -import { PrismaService } from './prisma.service'; -import { users as UserModel, Prisma } from '@prisma/client'; -import { UserRepository } from '../database/repositories/user'; - -const prisma = new PrismaService(); -const user = new UserRepository(prisma); - -@Controller() -export class UserController { - constructor(private readonly prismaService: PrismaService) {} - - @Get('users') - async getAllUsers(): Promise { - // just for the test - const userdata = await user.find('user'); - return userdata - } -} diff --git a/src/server/user/dto/createUser.dto.ts b/src/server/user/dto/createUser.dto.ts new file mode 100644 index 0000000..b22049a --- /dev/null +++ b/src/server/user/dto/createUser.dto.ts @@ -0,0 +1,5 @@ +export class CreateUserDto { + email: string; + username: string; + passwordhash: string; +} \ No newline at end of file diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts new file mode 100644 index 0000000..9313587 --- /dev/null +++ b/src/server/user/user.controller.ts @@ -0,0 +1,37 @@ + +import { + Controller, + Get, + Param, + Post, + Body, + Put, + Delete, + Query, +} from '@nestjs/common'; +import { UserService } from './user.service'; +// import { PrismaService } from '.././prisma.service'; +// import { users as UserModel, Prisma } from '@prisma/client'; +// import { UserRepository } from '../../database/repositories/user'; +import { CreateUserDto } from './dto/createUser.dto'; + +// const prisma = new PrismaService(); +// const user = new UserRepository(prisma); + +@Controller() +export class UserController { + constructor( private userService : UserService) {} + + + @Post('/registration') + async addUser(@Body() dto: CreateUserDto) { + console.log(dto); + return this.userService.addUser(dto) + } + + @Get('/users') + async findUser(@Body('username') username: string) { + console.log(username); + return this.userService.findUser(username) + } +} diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts new file mode 100644 index 0000000..f615314 --- /dev/null +++ b/src/server/user/user.module.ts @@ -0,0 +1,10 @@ +import { Module } from "@nestjs/common"; +import { UserController } from "./user.controller"; +import {UserService} from './user.service' + +@Module({ + providers: [UserService], + exports: [UserService], + controllers:[UserController] +}) +export class UserModule{} \ No newline at end of file diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts new file mode 100644 index 0000000..83d1f7d --- /dev/null +++ b/src/server/user/user.service.ts @@ -0,0 +1,24 @@ +import { CreateUserDto } from "./dto/createUser.dto"; +import { Injectable } from "@nestjs/common"; + +import { PrismaService } from '.././prisma.service'; +// import { users as UserModel, Prisma } from '@prisma/client'; +import { UserRepository } from '../../database/repositories/user'; + +const prisma = new PrismaService(); +const user = new UserRepository(prisma); + +@Injectable() +export class UserService { + async addUser(dto: CreateUserDto) { + const newUser = await user.add(dto) + console.log(newUser); + + return newUser + } + async findUser(username) { + const specificUser = await user.find(username) + return specificUser + } + +} \ No newline at end of file From 624c5efe42ed3de6571243e162cbb928bcf37e37 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 04:21:52 +0200 Subject: [PATCH 10/78] jwt doesn't work --- package.json | 7 ++++++ src/server/app.module.ts | 3 ++- src/server/auth/auth.controller.ts | 0 src/server/auth/auth.module.ts | 14 +++++++++-- src/server/auth/auth.service.ts | 19 +++++++++++++-- src/server/auth/constants.ts | 3 +++ src/server/auth/jwt-auth.guard.ts | 5 ++++ src/server/auth/jwt.strategy.ts | 20 +++++++++++++++ src/server/auth/local-auth.guard.ts | 8 ++++++ src/server/auth/local.strategy.ts | 19 +++++++++++++++ src/server/user/user.controller.ts | 38 ++++++++++++++++++++++------- src/server/user/user.module.ts | 4 ++- src/server/user/user.service.ts | 5 ++++ 13 files changed, 130 insertions(+), 15 deletions(-) delete mode 100644 src/server/auth/auth.controller.ts create mode 100644 src/server/auth/constants.ts create mode 100644 src/server/auth/jwt-auth.guard.ts create mode 100644 src/server/auth/jwt.strategy.ts create mode 100644 src/server/auth/local-auth.guard.ts create mode 100644 src/server/auth/local.strategy.ts diff --git a/package.json b/package.json index 1239398..44e8676 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "@nestjs/cli": "^9.1.8", "@nestjs/common": "^9.2.1", "@nestjs/core": "^9.2.1", + "@nestjs/jwt": "^10.0.1", + "@nestjs/passport": "^9.0.0", "@nestjs/platform-express": "^9.2.1", "@nestjs/schematics": "^9.0.4", "@prisma/client": "^4.8.1", @@ -15,6 +17,9 @@ "express-validator": "^6.14.0", "jsonwebtoken": "^9.0.0", "mysql": "^2.18.1", + "passport": "^0.6.0", + "passport-jwt": "^4.0.1", + "passport-local": "^1.0.0", "puppeteer": "^13.0.1", "source-map-support": "^0.5.21", "tsconfig-paths": "4.1.1", @@ -27,6 +32,8 @@ "start": "npm run --prefix src/client build && npm run --prefix src/api start" }, "devDependencies": { + "@types/passport-jwt": "^3.0.8", + "@types/passport-local": "^1.0.35", "prisma": "^4.8.1" } } diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 68950d4..174a51f 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -16,8 +16,9 @@ import {Module} from "@nestjs/common"; import { RecipeModule } from './recipes/recipe.module'; import { PrismaService } from './prisma.service' import { UserModule } from "user/user.module"; +import { AuthModule } from "auth/auth.module"; @Module({ - imports: [RecipeModule,UserModule], + imports: [RecipeModule,UserModule,AuthModule] }) export class AppModule {} diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index 1e7a97b..e22bc74 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,9 +1,19 @@ +import { PrismaService } from './../prisma.service'; +import { jwtConstants } from './constants'; +import { JwtStrategy } from './jwt.strategy'; +import { LocalStrategy } from './local.strategy'; import { UserModule } from './../user/user.module'; import { Module } from "@nestjs/common"; import {AuthService} from './auth.service' +import { PassportModule } from '@nestjs/passport'; +import { JwtModule } from '@nestjs/jwt'; @Module({ - imports: [UserModule], - providers: [AuthService] + imports: [UserModule, PassportModule , JwtModule.register({ + secret : 'SECRET', + signOptions : {expiresIn: '60s'}, + })], + providers: [AuthService, LocalStrategy, JwtStrategy], + exports : [AuthService] }) export class AuthModule{} \ No newline at end of file diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index cf8387c..d265917 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,17 +1,32 @@ import { UserService } from './../user/user.service'; import { Injectable } from "@nestjs/common"; -import { StringLiteralType } from 'typescript'; +import { JwtService } from '@nestjs/jwt'; + @Injectable() export class AuthService{ - constructor(private userService: UserService) {} + constructor(private userService: UserService, private jwtService : JwtService) {} async validateUser(username : string, password: string): Promise { const user = await this.userService.findUser(username) + console.log(user); + if(user && user.password === password ) { return user } + return null + } + async login(user: any) { + const payload = { username : user.username, id : user.id} + return { + access_token : this.jwtService.sign(payload) + } + } + + async hello() { + return "hello" } + } \ No newline at end of file diff --git a/src/server/auth/constants.ts b/src/server/auth/constants.ts new file mode 100644 index 0000000..726a160 --- /dev/null +++ b/src/server/auth/constants.ts @@ -0,0 +1,3 @@ +export const jwtConstants = { + secret : "SECRET" +} \ No newline at end of file diff --git a/src/server/auth/jwt-auth.guard.ts b/src/server/auth/jwt-auth.guard.ts new file mode 100644 index 0000000..6af748c --- /dev/null +++ b/src/server/auth/jwt-auth.guard.ts @@ -0,0 +1,5 @@ +import { Injectable } from "@nestjs/common"; +import { AuthGuard } from "@nestjs/passport"; + +@Injectable() +export class JwtAuthGuard extends AuthGuard('jwt') {} \ No newline at end of file diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/jwt.strategy.ts new file mode 100644 index 0000000..fe4076d --- /dev/null +++ b/src/server/auth/jwt.strategy.ts @@ -0,0 +1,20 @@ + +import { Injectable } from "@nestjs/common"; +import { PassportStrategy } from "@nestjs/passport"; +import { ExtractJwt, Strategy} from 'passport-jwt' + +@Injectable() +export class JwtStrategy extends PassportStrategy(Strategy) { + constructor() { + super({ + jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), + secretOrKey: 'SECRET' + }) + } + async validate(payload : any) { + return { + id: payload.sub, + name : payload.name + } + } +} diff --git a/src/server/auth/local-auth.guard.ts b/src/server/auth/local-auth.guard.ts new file mode 100644 index 0000000..6a96334 --- /dev/null +++ b/src/server/auth/local-auth.guard.ts @@ -0,0 +1,8 @@ +import { Injectable } from "@nestjs/common"; +import { AuthGuard } from "@nestjs/passport"; + + +@Injectable() +export class LocalAuthGuard extends AuthGuard('local') { + +} \ No newline at end of file diff --git a/src/server/auth/local.strategy.ts b/src/server/auth/local.strategy.ts new file mode 100644 index 0000000..88415ad --- /dev/null +++ b/src/server/auth/local.strategy.ts @@ -0,0 +1,19 @@ +import { AuthService } from './auth.service'; +import { Injectable, UnauthorizedException } from "@nestjs/common"; +import {PassportStrategy} from "@nestjs/passport" +import {Strategy} from 'passport-local' + +@Injectable() +export class LocalStrategy extends PassportStrategy(Strategy) { + constructor(private authService : AuthService) { + super() + } + async validate(username: string, password : string) { + const user = await this.authService.validateUser(username, password) + if(!user) { + throw new UnauthorizedException() + } + return user + } + +} \ No newline at end of file diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 9313587..c34d527 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -8,30 +8,50 @@ import { Put, Delete, Query, + UseGuards, + Request } from '@nestjs/common'; import { UserService } from './user.service'; // import { PrismaService } from '.././prisma.service'; // import { users as UserModel, Prisma } from '@prisma/client'; // import { UserRepository } from '../../database/repositories/user'; import { CreateUserDto } from './dto/createUser.dto'; - +import { LocalAuthGuard } from 'auth/local-auth.guard'; +import { AuthService } from 'auth/auth.service'; +import { JwtAuthGuard } from 'auth/jwt-auth.guard'; // const prisma = new PrismaService(); // const user = new UserRepository(prisma); @Controller() export class UserController { - constructor( private userService : UserService) {} - + constructor( private userService : UserService, private authService: AuthService) {} @Post('/registration') - async addUser(@Body() dto: CreateUserDto) { - console.log(dto); + addUser(@Body() dto: CreateUserDto) { return this.userService.addUser(dto) } - @Get('/users') - async findUser(@Body('username') username: string) { - console.log(username); - return this.userService.findUser(username) + + // @UseGuards(LocalAuthGuard) + // @Post('/login') + // login(@Body('username') username: string) { + // const user = this.userService.findUser(username) + // const token = this.authService.login(user) + // return token + // } + + @Post('/login') + async login(@Body() user) { + return this.authService.login(user); + } + + // @UseGuards(JwtAuthGuard) + @Get('/hello') + sayHello() { + return this.authService.hello() + } + @Post('/user/recipes') + addFavRecipe(@Body() recipeData) { + return this.userService.addRecipe(recipeData) } } diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index f615314..d46f5c5 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -1,9 +1,11 @@ +import { JwtService } from '@nestjs/jwt'; import { Module } from "@nestjs/common"; +import { AuthService } from "auth/auth.service"; import { UserController } from "./user.controller"; import {UserService} from './user.service' @Module({ - providers: [UserService], + providers: [UserService,AuthService,JwtService], exports: [UserService], controllers:[UserController] }) diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 83d1f7d..dc7fcf8 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -21,4 +21,9 @@ export class UserService { return specificUser } + async addRecipe(recipeData) { + const userFavRecipe = await user.addRecipe(recipeData) + return userFavRecipe + } + } \ No newline at end of file From edf2fa2782b4ed67f6404cffdd3e628db52c4a34 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Wed, 11 Jan 2023 18:09:57 +0200 Subject: [PATCH 11/78] Nest cli auth example --- .eslintrc.json | 4 +++- src/server/auth/auth.module.ts | 7 +++---- src/server/auth/auth.service.ts | 15 +++++++++------ src/server/auth/constants.ts | 4 ++-- src/server/auth/jwt.strategy.ts | 1 - src/server/main.ts | 4 ++-- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7919d31..efe0ddb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,8 +5,10 @@ "node": true }, "extends": ["eslint:recommended"], + "parser": "babel-eslint", "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 2020, + "sourceType": "module" }, "rules": { "indent": ["error", 2], diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index e22bc74..fd8aa2b 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,8 +1,7 @@ -import { PrismaService } from './../prisma.service'; import { jwtConstants } from './constants'; import { JwtStrategy } from './jwt.strategy'; import { LocalStrategy } from './local.strategy'; -import { UserModule } from './../user/user.module'; +import { UserModule } from '../user/user.module'; import { Module } from "@nestjs/common"; import {AuthService} from './auth.service' import { PassportModule } from '@nestjs/passport'; @@ -13,7 +12,7 @@ import { JwtModule } from '@nestjs/jwt'; secret : 'SECRET', signOptions : {expiresIn: '60s'}, })], - providers: [AuthService, LocalStrategy, JwtStrategy], + providers: [AuthService, LocalStrategy, JwtStrategy], exports : [AuthService] }) -export class AuthModule{} \ No newline at end of file +export class AuthModule{} diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index d265917..729ba1d 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,25 +1,28 @@ -import { UserService } from './../user/user.service'; +import { UserService } from '../user/user.service'; import { Injectable } from "@nestjs/common"; import { JwtService } from '@nestjs/jwt'; -@Injectable() +@Injectable() export class AuthService{ constructor(private userService: UserService, private jwtService : JwtService) {} async validateUser(username : string, password: string): Promise { const user = await this.userService.findUser(username) console.log(user); - + if(user && user.password === password ) { return user } - return null + return null } async login(user: any) { - const payload = { username : user.username, id : user.id} + const payload = { username : user.username, id : user.id}; + + console.log(payload, this.jwtService) + return { access_token : this.jwtService.sign(payload) } @@ -29,4 +32,4 @@ export class AuthService{ return "hello" } -} \ No newline at end of file +} diff --git a/src/server/auth/constants.ts b/src/server/auth/constants.ts index 726a160..6fa035d 100644 --- a/src/server/auth/constants.ts +++ b/src/server/auth/constants.ts @@ -1,3 +1,3 @@ export const jwtConstants = { - secret : "SECRET" -} \ No newline at end of file + secret: 'SECRET' +}; diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/jwt.strategy.ts index fe4076d..d1b3252 100644 --- a/src/server/auth/jwt.strategy.ts +++ b/src/server/auth/jwt.strategy.ts @@ -1,4 +1,3 @@ - import { Injectable } from "@nestjs/common"; import { PassportStrategy } from "@nestjs/passport"; import { ExtractJwt, Strategy} from 'passport-jwt' diff --git a/src/server/main.ts b/src/server/main.ts index 9fa9b6f..8ebe31c 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -13,8 +13,8 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import * as Process from 'process'; -import * as dotenv from 'dotenv' -dotenv.config() +import * as dotenv from 'dotenv'; +dotenv.config(); const start = async () => { try { From 907e035f4ed2f5346c399ad90b8b36f0bea07f66 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Wed, 11 Jan 2023 18:16:14 +0200 Subject: [PATCH 12/78] Nest cli auth example once more --- src/test-server | 1 + 1 file changed, 1 insertion(+) create mode 160000 src/test-server diff --git a/src/test-server b/src/test-server new file mode 160000 index 0000000..3558fac --- /dev/null +++ b/src/test-server @@ -0,0 +1 @@ +Subproject commit 3558facef1c7365137e19660dc9b34f08d473830 From ad6cd9fed111595c54510d32024cb540cd478276 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 18:36:10 +0200 Subject: [PATCH 13/78] access token returns --- .idea/.gitignore | 5 ++ .idea/codeStyles/Project.xml | 61 +++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++ .idea/cyberchef.iml | 12 ++++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ src/server/auth/auth.controller.ts | 17 ++++++ src/server/auth/auth.module.ts | 33 +++++++--- src/server/auth/auth.service.ts | 90 ++++++++++++++++++++-------- src/server/auth/local.strategy.ts | 19 ------ src/server/user/user.controller.ts | 18 +++--- 11 files changed, 213 insertions(+), 61 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/cyberchef.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 src/server/auth/auth.controller.ts delete mode 100644 src/server/auth/local.strategy.ts diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7ba3bc0 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/cyberchef.iml b/.idea/cyberchef.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/cyberchef.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..34d5e16 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts new file mode 100644 index 0000000..9e4c07e --- /dev/null +++ b/src/server/auth/auth.controller.ts @@ -0,0 +1,17 @@ +import { Body, Controller, Post } from '@nestjs/common'; +import { AuthService } from './auth.service'; + +@Controller('auth') +export class AuthController { + constructor(private authService: AuthService) {} + + @Post('/registration') + addUser(@Body() dto: any) { + return this.authService.register(dto); + } + + @Post('/login') + async login(@Body() user) { + return this.authService.login(user); + } +} diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index e22bc74..8b8740f 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,19 +1,34 @@ import { PrismaService } from './../prisma.service'; import { jwtConstants } from './constants'; import { JwtStrategy } from './jwt.strategy'; -import { LocalStrategy } from './local.strategy'; import { UserModule } from './../user/user.module'; import { Module } from "@nestjs/common"; import {AuthService} from './auth.service' import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; +import { AuthController } from './auth.controller'; + +// @Module({ +// imports: [UserModule, PassportModule , JwtModule.register({ +// secret : 'SECRET', +// signOptions : {expiresIn: '60s'}, +// })], +// providers: [AuthService, LocalStrategy, JwtStrategy], +// exports : [AuthService] +// }) +// export class AuthModule{} @Module({ - imports: [UserModule, PassportModule , JwtModule.register({ - secret : 'SECRET', - signOptions : {expiresIn: '60s'}, - })], - providers: [AuthService, LocalStrategy, JwtStrategy], - exports : [AuthService] -}) -export class AuthModule{} \ No newline at end of file + imports: [ + PassportModule, + JwtModule.register({ + secret: 'SECRET', + signOptions: { expiresIn: '60s' }, + }), + ], + providers: [AuthService], + controllers: [AuthController], + exports: [AuthService], + }) + export class AuthModule {} + \ No newline at end of file diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index d265917..4fc2015 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,32 +1,74 @@ -import { UserService } from './../user/user.service'; -import { Injectable } from "@nestjs/common"; -import { JwtService } from '@nestjs/jwt'; +// import { UserService } from './../user/user.service'; +// import { Injectable } from "@nestjs/common"; +// import { JwtService } from '@nestjs/jwt'; -@Injectable() -export class AuthService{ - constructor(private userService: UserService, private jwtService : JwtService) {} +// @Injectable() +// export class AuthService{ +// constructor(private userService: UserService, private jwtService : JwtService) {} - async validateUser(username : string, password: string): Promise { - const user = await this.userService.findUser(username) - console.log(user); +// async validateUser(username : string, password: string): Promise { +// const user = await this.userService.findUser(username) +// console.log(user); - if(user && user.password === password ) { - return user - } - return null - } +// if(user && user.password === password ) { +// return user +// } +// return null +// } + +// async login(user: any) { +// const payload = { username : user.username, id : user.id} +// return { +// access_token : this.jwtService.sign(payload) +// } +// } + +// async hello() { +// return "hello" +// } + +// } + +import { Injectable } from '@nestjs/common'; +import { JwtService } from '@nestjs/jwt'; + +@Injectable() +export class AuthService { + constructor(private jwtService: JwtService) {} + + // async validateUser(username: string, password: string): Promise { + // // //const user = await this.userService.findUser(username); + // // console.log(user); + // // + // // if (user && user.password === password) { + // // return user; + // // } + // // return null; + // } + + async login(user: any) { + const payload = { username: user.username, id: user.id }; + + console.log(payload, this.jwtService); + + return { + access_token: this.jwtService.sign(payload), + }; + } + + async register(user: any) { + const payload = { username: user.username, id: user.id }; - async login(user: any) { - const payload = { username : user.username, id : user.id} - return { - access_token : this.jwtService.sign(payload) - } - } + console.log(payload, this.jwtService); - async hello() { - return "hello" - } + return { + access_token: this.jwtService.sign(payload), + }; + } -} \ No newline at end of file + async hello() { + return 'hello'; + } +} diff --git a/src/server/auth/local.strategy.ts b/src/server/auth/local.strategy.ts deleted file mode 100644 index 88415ad..0000000 --- a/src/server/auth/local.strategy.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AuthService } from './auth.service'; -import { Injectable, UnauthorizedException } from "@nestjs/common"; -import {PassportStrategy} from "@nestjs/passport" -import {Strategy} from 'passport-local' - -@Injectable() -export class LocalStrategy extends PassportStrategy(Strategy) { - constructor(private authService : AuthService) { - super() - } - async validate(username: string, password : string) { - const user = await this.authService.validateUser(username, password) - if(!user) { - throw new UnauthorizedException() - } - return user - } - -} \ No newline at end of file diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index c34d527..e8bf6c8 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -33,18 +33,18 @@ export class UserController { // @UseGuards(LocalAuthGuard) - // @Post('/login') - // login(@Body('username') username: string) { - // const user = this.userService.findUser(username) - // const token = this.authService.login(user) - // return token - // } - @Post('/login') - async login(@Body() user) { - return this.authService.login(user); + login(@Body('username') username: string) { + const user = this.userService.findUser(username) + const token = this.authService.login(user) + return token } + // @Post('/login') + // async login(@Body() user) { + // return this.authService.login(user); + // } + // @UseGuards(JwtAuthGuard) @Get('/hello') sayHello() { From d198cf48f148bb3148e24426e7a1b5e413bcebbe Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 18:42:59 +0200 Subject: [PATCH 14/78] jwt commit --- src/server/auth/auth.module.ts | 19 +------- src/server/auth/auth.service.ts | 73 ------------------------------ src/server/user/user.controller.ts | 27 ----------- 3 files changed, 2 insertions(+), 117 deletions(-) diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index 6a7780d..8b8740f 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,11 +1,7 @@ +import { PrismaService } from './../prisma.service'; import { jwtConstants } from './constants'; import { JwtStrategy } from './jwt.strategy'; -<<<<<<< HEAD import { UserModule } from './../user/user.module'; -======= -import { LocalStrategy } from './local.strategy'; -import { UserModule } from '../user/user.module'; ->>>>>>> 907e035f4ed2f5346c399ad90b8b36f0bea07f66 import { Module } from "@nestjs/common"; import {AuthService} from './auth.service' import { PassportModule } from '@nestjs/passport'; @@ -23,7 +19,6 @@ import { AuthController } from './auth.controller'; // export class AuthModule{} @Module({ -<<<<<<< HEAD imports: [ PassportModule, JwtModule.register({ @@ -36,14 +31,4 @@ import { AuthController } from './auth.controller'; exports: [AuthService], }) export class AuthModule {} - -======= - imports: [UserModule, PassportModule , JwtModule.register({ - secret : 'SECRET', - signOptions : {expiresIn: '60s'}, - })], - providers: [AuthService, LocalStrategy, JwtStrategy], - exports : [AuthService] -}) -export class AuthModule{} ->>>>>>> 907e035f4ed2f5346c399ad90b8b36f0bea07f66 + \ No newline at end of file diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 3ca9168..3d8f1c0 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,69 +1,3 @@ -<<<<<<< HEAD -// import { UserService } from './../user/user.service'; -// import { Injectable } from "@nestjs/common"; -// import { JwtService } from '@nestjs/jwt'; - - -// @Injectable() -// export class AuthService{ -// constructor(private userService: UserService, private jwtService : JwtService) {} - -// async validateUser(username : string, password: string): Promise { -// const user = await this.userService.findUser(username) -// console.log(user); - - -// if(user && user.password === password ) { -// return user -// } -// return null -// } - -// async login(user: any) { -// const payload = { username : user.username, id : user.id} -// return { -// access_token : this.jwtService.sign(payload) -// } -// } - -// async hello() { -// return "hello" -// } - -// } - -import { Injectable } from '@nestjs/common'; -import { JwtService } from '@nestjs/jwt'; - -@Injectable() -export class AuthService { - constructor(private jwtService: JwtService) {} - - // async validateUser(username: string, password: string): Promise { - // // //const user = await this.userService.findUser(username); - // // console.log(user); - // // - // // if (user && user.password === password) { - // // return user; - // // } - // // return null; - // } - - async login(user: any) { - const payload = { username: user.username, id: user.id }; - - console.log(payload, this.jwtService); - - return { - access_token: this.jwtService.sign(payload), - }; - } - - async register(user: any) { - const payload = { username: user.username, id: user.id }; - - console.log(payload, this.jwtService); -======= import { UserService } from '../user/user.service'; import { Injectable } from "@nestjs/common"; import { JwtService } from '@nestjs/jwt'; @@ -93,17 +27,10 @@ export class AuthService{ access_token : this.jwtService.sign(payload) } } ->>>>>>> 907e035f4ed2f5346c399ad90b8b36f0bea07f66 return { access_token: this.jwtService.sign(payload), }; } -<<<<<<< HEAD - async hello() { - return 'hello'; - } -======= ->>>>>>> 907e035f4ed2f5346c399ad90b8b36f0bea07f66 } diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index e8bf6c8..f9f42dc 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -26,32 +26,5 @@ import { JwtAuthGuard } from 'auth/jwt-auth.guard'; export class UserController { constructor( private userService : UserService, private authService: AuthService) {} - @Post('/registration') - addUser(@Body() dto: CreateUserDto) { - return this.userService.addUser(dto) - } - - // @UseGuards(LocalAuthGuard) - @Post('/login') - login(@Body('username') username: string) { - const user = this.userService.findUser(username) - const token = this.authService.login(user) - return token - } - - // @Post('/login') - // async login(@Body() user) { - // return this.authService.login(user); - // } - - // @UseGuards(JwtAuthGuard) - @Get('/hello') - sayHello() { - return this.authService.hello() - } - @Post('/user/recipes') - addFavRecipe(@Body() recipeData) { - return this.userService.addRecipe(recipeData) - } } From fa13d9ec8e45b12cb3821c823f98b7777d345889 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 18:44:04 +0200 Subject: [PATCH 15/78] auth controller return jwt token --- src/server/auth/auth.service.ts | 45 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 3d8f1c0..000fb3e 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,36 +1,41 @@ -import { UserService } from '../user/user.service'; -import { Injectable } from "@nestjs/common"; +import { Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; - @Injectable() -export class AuthService{ - constructor(private userService: UserService, private jwtService : JwtService) {} +export class AuthService { + constructor(private jwtService: JwtService) {} - async validateUser(username : string, password: string): Promise { - const user = await this.userService.findUser(username) - console.log(user); + // async validateUser(username: string, password: string): Promise { + // // //const user = await this.userService.findUser(username); + // // console.log(user); + // // + // // if (user && user.password === password) { + // // return user; + // // } + // // return null; + // } + async login(user: any) { + const payload = { username: user.username, id: user.id }; - if(user && user.password === password ) { - return user - } - return null - } + console.log(payload, this.jwtService); - async login(user: any) { - const payload = { username : user.username, id : user.id}; + return { + access_token: this.jwtService.sign(payload), + }; + } - console.log(payload, this.jwtService) + async register(user: any) { + const payload = { username: user.username, id: user.id }; - return { - access_token : this.jwtService.sign(payload) - } - } + console.log(payload, this.jwtService); return { access_token: this.jwtService.sign(payload), }; } + async hello() { + return 'hello'; + } } From bb0e8cb8ad4f615fd7670968548cccf1c305d93e Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 20:24:13 +0200 Subject: [PATCH 16/78] all request added to controllers --- package.json | 3 ++- src/server/auth/auth.controller.ts | 7 +++++-- src/server/auth/auth.module.ts | 5 +++-- src/server/auth/auth.service.ts | 19 ++++++++++--------- src/server/auth/jwt.strategy.ts | 5 ++--- src/server/user/user.controller.ts | 30 +++++++++++++++++++++++++++++- src/server/user/user.module.ts | 3 ++- src/server/user/user.service.ts | 9 +++++++++ 8 files changed, 62 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 44e8676..b327fd6 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "scripts": { "preinstall": "sudo npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", "installDependecies": "npm --prefix src/client install && npm --prefix src/api install", - "start": "npm run --prefix src/client build && npm run --prefix src/api start" + "start": "npm run --prefix src/client build && npm run --prefix src/api start", + "start:dev":"nest start --watch" }, "devDependencies": { "@types/passport-jwt": "^3.0.8", diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 9e4c07e..2edcd9a 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,9 +1,10 @@ +import { UserService } from './../user/user.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; @Controller('auth') export class AuthController { - constructor(private authService: AuthService) {} + constructor(private authService: AuthService, private userService : UserService) {} @Post('/registration') addUser(@Body() dto: any) { @@ -11,7 +12,9 @@ export class AuthController { } @Post('/login') - async login(@Body() user) { + async login(@Body() userData) { + const user = await this.userService.findUser(userData.username) return this.authService.login(user); } + } diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index 8b8740f..c69e6f7 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,3 +1,4 @@ +import { UserService } from './../user/user.service'; import { PrismaService } from './../prisma.service'; import { jwtConstants } from './constants'; import { JwtStrategy } from './jwt.strategy'; @@ -23,10 +24,10 @@ import { AuthController } from './auth.controller'; PassportModule, JwtModule.register({ secret: 'SECRET', - signOptions: { expiresIn: '60s' }, + signOptions: { expiresIn: '3660s' }, }), ], - providers: [AuthService], + providers: [AuthService, JwtStrategy,UserService], controllers: [AuthController], exports: [AuthService], }) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 000fb3e..efe3762 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -15,21 +15,22 @@ export class AuthService { // // return null; // } - async login(user: any) { + async login(user) { const payload = { username: user.username, id: user.id }; - - console.log(payload, this.jwtService); - return { - access_token: this.jwtService.sign(payload), + access_token: this.jwtService.sign(payload) }; } - async register(user: any) { - const payload = { username: user.username, id: user.id }; - - console.log(payload, this.jwtService); +// async getUserId(req) { +// const token = req.headers.authorization; +// const payload = jwt.verify(token, process.env.JWT_ACCESS_SECRET); +// return payload.id; +// } + async register(user) { + const payload = { username: user.username, id: user.id }; + // console.log(payload, this.jwtService); return { access_token: this.jwtService.sign(payload), }; diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/jwt.strategy.ts index d1b3252..6249008 100644 --- a/src/server/auth/jwt.strategy.ts +++ b/src/server/auth/jwt.strategy.ts @@ -10,10 +10,9 @@ export class JwtStrategy extends PassportStrategy(Strategy) { secretOrKey: 'SECRET' }) } - async validate(payload : any) { + async validate(payload) { return { - id: payload.sub, - name : payload.name + userId : payload.id } } } diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index f9f42dc..6c0ca15 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,3 +1,4 @@ +import { JwtStrategy } from './../auth/jwt.strategy'; import { Controller, @@ -26,5 +27,32 @@ import { JwtAuthGuard } from 'auth/jwt-auth.guard'; export class UserController { constructor( private userService : UserService, private authService: AuthService) {} - // @UseGuards(LocalAuthGuard) + @UseGuards(JwtAuthGuard) + @Post('/user/recipes') + addFavRecipe(@Request() req) { + const userId = req.user.userId + const recipeId = req.body.recipeId + + const recipeData = {"userId" : userId, "recipeId" : recipeId} + return this.userService.addRecipe(recipeData) + } + + @UseGuards(JwtAuthGuard) + @Get('/user/recipes') + getFavRecipes(@Request() req) { + const userId = req.user.userId + return this.userService.getRecipes(userId) + } + + @UseGuards(JwtAuthGuard) + @Delete('/user/recipes') + deleteFavRecipe(@Request() req) { + const userId = req.user.userId + const recipeId = req.body.recipeId + + const recipeData = {"userId" : userId, "recipeId" : recipeId} + return this.userService.deleteRecipe(recipeData) + } + + } diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index d46f5c5..ac9811f 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -1,3 +1,4 @@ +import { JwtStrategy } from './../auth/jwt.strategy'; import { JwtService } from '@nestjs/jwt'; import { Module } from "@nestjs/common"; import { AuthService } from "auth/auth.service"; @@ -5,7 +6,7 @@ import { UserController } from "./user.controller"; import {UserService} from './user.service' @Module({ - providers: [UserService,AuthService,JwtService], + providers: [UserService,AuthService,JwtService,JwtStrategy], exports: [UserService], controllers:[UserController] }) diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index dc7fcf8..c0fc2a2 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -26,4 +26,13 @@ export class UserService { return userFavRecipe } + async getRecipes(recipeData) { + const userFavRecipes = await user.findRecipes(recipeData) + return userFavRecipes + } + + async deleteRecipe(recipeData) { + const deleteRecipe = await user.deleteRecipe(recipeData) + return deleteRecipe + } } \ No newline at end of file From 7ee7b765e5b7150991a441649baabd732679d762 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 20:35:31 +0200 Subject: [PATCH 17/78] get favouire recipes function fixed --- src/server/user/user.controller.ts | 13 ++++++++++--- src/server/user/user.module.ts | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 6c0ca15..e57e671 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,3 +1,4 @@ +import { RecipeService } from './../recipes/recipe.service'; import { JwtStrategy } from './../auth/jwt.strategy'; import { @@ -25,7 +26,8 @@ import { JwtAuthGuard } from 'auth/jwt-auth.guard'; @Controller() export class UserController { - constructor( private userService : UserService, private authService: AuthService) {} + constructor( private userService : UserService, private authService: AuthService, + private recipeService : RecipeService) {} @UseGuards(JwtAuthGuard) @Post('/user/recipes') @@ -39,9 +41,14 @@ export class UserController { @UseGuards(JwtAuthGuard) @Get('/user/recipes') - getFavRecipes(@Request() req) { + async getFavRecipes(@Request() req) { const userId = req.user.userId - return this.userService.getRecipes(userId) + const recipesId = await this.userService.getRecipes(userId) + let favRecipes = [] + for(let el of recipesId){ + favRecipes.push(await this.recipeService.getRecipeById(el)) + } + return favRecipes } @UseGuards(JwtAuthGuard) diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index ac9811f..adc4a5c 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -1,3 +1,4 @@ +import { RecipeService } from './../recipes/recipe.service'; import { JwtStrategy } from './../auth/jwt.strategy'; import { JwtService } from '@nestjs/jwt'; import { Module } from "@nestjs/common"; @@ -6,7 +7,7 @@ import { UserController } from "./user.controller"; import {UserService} from './user.service' @Module({ - providers: [UserService,AuthService,JwtService,JwtStrategy], + providers: [UserService,AuthService,JwtService,JwtStrategy,RecipeService], exports: [UserService], controllers:[UserController] }) From 139e84fad943446c1972ee815d9002bc30635c15 Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 21:12:14 +0200 Subject: [PATCH 18/78] added user registration --- src/server/auth/auth.controller.ts | 17 +++++++---- src/server/auth/auth.service.ts | 45 +++++++++++------------------ src/server/auth/local-auth.guard.ts | 8 ----- src/server/user/user.controller.ts | 7 ----- src/server/user/user.service.ts | 2 -- 5 files changed, 29 insertions(+), 50 deletions(-) delete mode 100644 src/server/auth/local-auth.guard.ts diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 2edcd9a..5d53423 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,3 +1,5 @@ +import { CreateUserDto } from './../user/dto/createUser.dto'; +import { CreateRecipeDto } from './../recipes/recipe.dto'; import { UserService } from './../user/user.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; @@ -7,14 +9,19 @@ export class AuthController { constructor(private authService: AuthService, private userService : UserService) {} @Post('/registration') - addUser(@Body() dto: any) { - return this.authService.register(dto); + async addUser(@Body() dto: CreateUserDto) { + return await this.authService.register(dto); } @Post('/login') async login(@Body() userData) { const user = await this.userService.findUser(userData.username) - return this.authService.login(user); - } - + try{ + await this.authService.validateUser(user.username, user.password) + return this.authService.login(user) + } + catch(e){ + console.error(e) + } +} } diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index efe3762..dff4ea4 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,42 +1,31 @@ +import { CreateUserDto } from './../user/dto/createUser.dto'; +import { UserService } from './../user/user.service'; import { Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; @Injectable() export class AuthService { - constructor(private jwtService: JwtService) {} + constructor(private jwtService: JwtService, private userService: UserService) {} - // async validateUser(username: string, password: string): Promise { - // // //const user = await this.userService.findUser(username); - // // console.log(user); - // // - // // if (user && user.password === password) { - // // return user; - // // } - // // return null; - // } + async validateUser(username: string, password: string): Promise { + const user = await this.userService.findUser(username); + console.log(user); + + if (user && user.password === password) { + return user; + } + return null; + } async login(user) { - const payload = { username: user.username, id: user.id }; - return { + const payload = { username: user.username, id: user.id }; + return { access_token: this.jwtService.sign(payload) }; } -// async getUserId(req) { -// const token = req.headers.authorization; -// const payload = jwt.verify(token, process.env.JWT_ACCESS_SECRET); -// return payload.id; -// } - - async register(user) { - const payload = { username: user.username, id: user.id }; - // console.log(payload, this.jwtService); - return { - access_token: this.jwtService.sign(payload), - }; - } - - async hello() { - return 'hello'; + async register(dto : CreateUserDto) { + const user = await this.userService.addUser(dto) + return user } } diff --git a/src/server/auth/local-auth.guard.ts b/src/server/auth/local-auth.guard.ts deleted file mode 100644 index 6a96334..0000000 --- a/src/server/auth/local-auth.guard.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Injectable } from "@nestjs/common"; -import { AuthGuard } from "@nestjs/passport"; - - -@Injectable() -export class LocalAuthGuard extends AuthGuard('local') { - -} \ No newline at end of file diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index e57e671..f577413 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,5 +1,4 @@ import { RecipeService } from './../recipes/recipe.service'; -import { JwtStrategy } from './../auth/jwt.strategy'; import { Controller, @@ -14,15 +13,9 @@ import { Request } from '@nestjs/common'; import { UserService } from './user.service'; -// import { PrismaService } from '.././prisma.service'; -// import { users as UserModel, Prisma } from '@prisma/client'; -// import { UserRepository } from '../../database/repositories/user'; import { CreateUserDto } from './dto/createUser.dto'; -import { LocalAuthGuard } from 'auth/local-auth.guard'; import { AuthService } from 'auth/auth.service'; import { JwtAuthGuard } from 'auth/jwt-auth.guard'; -// const prisma = new PrismaService(); -// const user = new UserRepository(prisma); @Controller() export class UserController { diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index c0fc2a2..f881f05 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -12,8 +12,6 @@ const user = new UserRepository(prisma); export class UserService { async addUser(dto: CreateUserDto) { const newUser = await user.add(dto) - console.log(newUser); - return newUser } async findUser(username) { From b51fd6fa9e45d9ac2d4cf61ee61df352b0c0dd5f Mon Sep 17 00:00:00 2001 From: water-korra Date: Wed, 11 Jan 2023 23:51:05 +0200 Subject: [PATCH 19/78] comments deleted --- package.json | 5 +++-- src/server/auth/auth.controller.ts | 12 +++--------- src/server/auth/auth.module.ts | 15 +-------------- src/server/auth/auth.service.ts | 15 +++++++++++---- src/server/auth/constants.ts | 3 --- src/server/auth/jwt.strategy.ts | 2 +- src/server/main.ts | 13 ------------- src/server/user/dto/createUser.dto.ts | 5 ----- src/server/user/user.controller.ts | 9 ++++----- src/server/user/user.service.ts | 8 +++----- 10 files changed, 26 insertions(+), 61 deletions(-) delete mode 100644 src/server/auth/constants.ts delete mode 100644 src/server/user/dto/createUser.dto.ts diff --git a/package.json b/package.json index b327fd6..a18842e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@nestjs/platform-express": "^9.2.1", "@nestjs/schematics": "^9.0.4", "@prisma/client": "^4.8.1", - "bcrypt": "^5.0.1", + "bcrypt": "^5.1.0", "chalk": "^5.0.0", "cheerio": "^1.0.0-rc.10", "dotenv": "^10.0.0", @@ -30,9 +30,10 @@ "preinstall": "sudo npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", "installDependecies": "npm --prefix src/client install && npm --prefix src/api install", "start": "npm run --prefix src/client build && npm run --prefix src/api start", - "start:dev":"nest start --watch" + "start:dev": "nest start --watch" }, "devDependencies": { + "@types/bcrypt": "^5.0.0", "@types/passport-jwt": "^3.0.8", "@types/passport-local": "^1.0.35", "prisma": "^4.8.1" diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 5d53423..8abc189 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,5 +1,4 @@ -import { CreateUserDto } from './../user/dto/createUser.dto'; -import { CreateRecipeDto } from './../recipes/recipe.dto'; + import { UserService } from './../user/user.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; @@ -9,19 +8,14 @@ export class AuthController { constructor(private authService: AuthService, private userService : UserService) {} @Post('/registration') - async addUser(@Body() dto: CreateUserDto) { - return await this.authService.register(dto); + async addUser(@Body() regData) { + return await this.authService.register(regData); } @Post('/login') async login(@Body() userData) { const user = await this.userService.findUser(userData.username) - try{ await this.authService.validateUser(user.username, user.password) return this.authService.login(user) - } - catch(e){ - console.error(e) - } } } diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index c69e6f7..43a56e1 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,29 +1,16 @@ import { UserService } from './../user/user.service'; -import { PrismaService } from './../prisma.service'; -import { jwtConstants } from './constants'; import { JwtStrategy } from './jwt.strategy'; -import { UserModule } from './../user/user.module'; import { Module } from "@nestjs/common"; import {AuthService} from './auth.service' import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { AuthController } from './auth.controller'; -// @Module({ -// imports: [UserModule, PassportModule , JwtModule.register({ -// secret : 'SECRET', -// signOptions : {expiresIn: '60s'}, -// })], -// providers: [AuthService, LocalStrategy, JwtStrategy], -// exports : [AuthService] -// }) -// export class AuthModule{} - @Module({ imports: [ PassportModule, JwtModule.register({ - secret: 'SECRET', + secret: process.env.JWT_SECRET_KEY, signOptions: { expiresIn: '3660s' }, }), ], diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index dff4ea4..0633ecb 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,7 +1,7 @@ -import { CreateUserDto } from './../user/dto/createUser.dto'; import { UserService } from './../user/user.service'; -import { Injectable } from '@nestjs/common'; +import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; +import * as bcrypt from 'bcrypt'; @Injectable() export class AuthService { @@ -18,14 +18,21 @@ export class AuthService { } async login(user) { + if(!user) { + throw new BadRequestException('invalid user') + } const payload = { username: user.username, id: user.id }; return { access_token: this.jwtService.sign(payload) }; } - async register(dto : CreateUserDto) { - const user = await this.userService.addUser(dto) + async register(regData) { + const passwordhash = await bcrypt.hash(regData.password,12) + const userRegData = {"email": regData.email, + "username" : regData.username, + "passwordhash":passwordhash} + const user = await this.userService.addUser(userRegData) return user } } diff --git a/src/server/auth/constants.ts b/src/server/auth/constants.ts deleted file mode 100644 index 6fa035d..0000000 --- a/src/server/auth/constants.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const jwtConstants = { - secret: 'SECRET' -}; diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/jwt.strategy.ts index 6249008..445ab24 100644 --- a/src/server/auth/jwt.strategy.ts +++ b/src/server/auth/jwt.strategy.ts @@ -7,7 +7,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) { constructor() { super({ jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), - secretOrKey: 'SECRET' + secretOrKey: process.env.JWT_SECRET_KEY }) } async validate(payload) { diff --git a/src/server/main.ts b/src/server/main.ts index 8ebe31c..6b7607f 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -1,15 +1,3 @@ -// import { NestFactory } from '@nestjs/core'; -// import { AppModule } from './app.module'; -// import * as dotenv from 'dotenv' -// dotenv.config() - -// async function bootstrap() { -// const app = await NestFactory.create(AppModule); -// await app.listen(3000); -// } -// bootstrap(); - - import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import * as Process from 'process'; @@ -20,7 +8,6 @@ const start = async () => { try { const PORT = Process.env.PORT || 5001; const app = await NestFactory.create(AppModule); - // app.enableCors(); await app.listen(PORT, () => console.log(`server started on PORT ${PORT}`)); } catch (e) { console.log(e); diff --git a/src/server/user/dto/createUser.dto.ts b/src/server/user/dto/createUser.dto.ts deleted file mode 100644 index b22049a..0000000 --- a/src/server/user/dto/createUser.dto.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class CreateUserDto { - email: string; - username: string; - passwordhash: string; -} \ No newline at end of file diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index f577413..564606b 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -13,17 +13,16 @@ import { Request } from '@nestjs/common'; import { UserService } from './user.service'; -import { CreateUserDto } from './dto/createUser.dto'; import { AuthService } from 'auth/auth.service'; import { JwtAuthGuard } from 'auth/jwt-auth.guard'; -@Controller() +@Controller('/user/recipes') export class UserController { constructor( private userService : UserService, private authService: AuthService, private recipeService : RecipeService) {} @UseGuards(JwtAuthGuard) - @Post('/user/recipes') + @Post() addFavRecipe(@Request() req) { const userId = req.user.userId const recipeId = req.body.recipeId @@ -33,7 +32,7 @@ export class UserController { } @UseGuards(JwtAuthGuard) - @Get('/user/recipes') + @Get() async getFavRecipes(@Request() req) { const userId = req.user.userId const recipesId = await this.userService.getRecipes(userId) @@ -45,7 +44,7 @@ export class UserController { } @UseGuards(JwtAuthGuard) - @Delete('/user/recipes') + @Delete() deleteFavRecipe(@Request() req) { const userId = req.user.userId const recipeId = req.body.recipeId diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index f881f05..a671cae 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,8 +1,6 @@ -import { CreateUserDto } from "./dto/createUser.dto"; import { Injectable } from "@nestjs/common"; import { PrismaService } from '.././prisma.service'; -// import { users as UserModel, Prisma } from '@prisma/client'; import { UserRepository } from '../../database/repositories/user'; const prisma = new PrismaService(); @@ -10,9 +8,9 @@ const user = new UserRepository(prisma); @Injectable() export class UserService { - async addUser(dto: CreateUserDto) { - const newUser = await user.add(dto) - return newUser + async addUser(regData) { + const newUser = await user.add(regData) + return newUser } async findUser(username) { const specificUser = await user.find(username) From a874c573843ce95265636973ae1686eeae2ea538 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 02:08:25 +0200 Subject: [PATCH 20/78] file structure improved, login validation now uses hash passwords --- .gitignore | 2 +- src/server/app.module.ts | 15 --------------- src/server/auth/auth.controller.ts | 7 ++++++- src/server/auth/auth.service.ts | 12 +++++------- src/server/recipes/{ => dto}/recipe.dto.ts | 0 src/server/recipes/recipe.controller.ts | 13 ++----------- src/server/recipes/recipe.service.ts | 3 +-- src/server/user/user.controller.ts | 1 - src/server/user/user.service.ts | 1 - 9 files changed, 15 insertions(+), 39 deletions(-) rename src/server/recipes/{ => dto}/recipe.dto.ts (100%) diff --git a/.gitignore b/.gitignore index 2347d50..9570eab 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ src/api/package.json src/database/prisma/migrations src/server/dist src/.env - +/.idea diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 174a51f..2b651c5 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -1,20 +1,5 @@ -// import { Module } from '@nestjs/common'; -// import { UserController } from './user.controller'; -// import { PrismaService } from './prisma.service' - -// @Module({ -// imports: [], -// controllers: [UserController], -// providers: [PrismaService], -// }) -// export class AppModule {} - - - - import {Module} from "@nestjs/common"; import { RecipeModule } from './recipes/recipe.module'; -import { PrismaService } from './prisma.service' import { UserModule } from "user/user.module"; import { AuthModule } from "auth/auth.module"; diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 8abc189..ed951be 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -15,7 +15,12 @@ export class AuthController { @Post('/login') async login(@Body() userData) { const user = await this.userService.findUser(userData.username) - await this.authService.validateUser(user.username, user.password) + const validateUser = await this.authService.validateUser(userData.username, userData.password,user) + if(validateUser === true) { return this.authService.login(user) + } + else{ + return 'incorrect username or password' + } } } diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 0633ecb..cb9e3a4 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -7,14 +7,12 @@ import * as bcrypt from 'bcrypt'; export class AuthService { constructor(private jwtService: JwtService, private userService: UserService) {} - async validateUser(username: string, password: string): Promise { - const user = await this.userService.findUser(username); - console.log(user); - - if (user && user.password === password) { - return user; + async validateUser(username: string, password: string, user: any ): Promise { + const passwordCheck = await bcrypt.compare(password, user.password); + if (user.username = username && passwordCheck === true) { + return true; } - return null; + return 'incorrect data'; } async login(user) { diff --git a/src/server/recipes/recipe.dto.ts b/src/server/recipes/dto/recipe.dto.ts similarity index 100% rename from src/server/recipes/recipe.dto.ts rename to src/server/recipes/dto/recipe.dto.ts diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 37d4001..442a69b 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,14 +1,12 @@ import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/common"; -import { CreateRecipeDto } from "./recipe.dto"; +import { CreateRecipeDto } from "./dto/recipe.dto"; import { RecipeService } from "./recipe.service"; @Controller("/api") export class RecipeController { constructor(private recipeService : RecipeService) {} @Post('/recipes') - addRecipe(@Body() dto: CreateRecipeDto) { - console.log(dto); - + addRecipe(@Body() dto: CreateRecipeDto) { return this.recipeService.addRecipe(dto); } @@ -26,13 +24,6 @@ export class RecipeController { getRecipeById(@Query('recipeId') recipeId : number) { return this.recipeService.getRecipeById(recipeId) } - - // @Post('/user/recipes') - // addFavRecipe(@Body()) {} - - getFavRecipes() {} - - deleteFavRecipe() {} } diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 9d65771..79f2ecc 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,9 +1,8 @@ import { RecipeModule } from './recipe.module'; import {Injectable} from '@nestjs/common'; -import { CreateRecipeDto } from './recipe.dto'; +import { CreateRecipeDto } from './dto/recipe.dto'; import { PrismaService } from '.././prisma.service'; -// import { recipes as RecipeModel, Prisma } from '@prisma/client'; import { RecipeRepository } from '../../database/repositories/recipe'; diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 564606b..ba72764 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -53,5 +53,4 @@ export class UserController { return this.userService.deleteRecipe(recipeData) } - } diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index a671cae..2b3b7b3 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,5 +1,4 @@ import { Injectable } from "@nestjs/common"; - import { PrismaService } from '.././prisma.service'; import { UserRepository } from '../../database/repositories/user'; From 485200aaea0fbf092a6b76a025e26b7c79f8f3f8 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 02:17:44 +0200 Subject: [PATCH 21/78] removed unnecessary user service from auth servie, controller --- src/server/auth/auth.controller.ts | 11 +++++++---- src/server/auth/auth.service.ts | 9 +++++++-- src/server/user/user.service.ts | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index ed951be..299fd3b 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,11 +1,14 @@ - -import { UserService } from './../user/user.service'; +import { PrismaService } from './../prisma.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; +import { UserRepository } from '../../database/repositories/user'; + +const prisma = new PrismaService() +const prismaUser = new UserRepository(prisma) @Controller('auth') export class AuthController { - constructor(private authService: AuthService, private userService : UserService) {} + constructor(private authService: AuthService) {} @Post('/registration') async addUser(@Body() regData) { @@ -14,7 +17,7 @@ export class AuthController { @Post('/login') async login(@Body() userData) { - const user = await this.userService.findUser(userData.username) + const user = await prismaUser.find(userData.username) const validateUser = await this.authService.validateUser(userData.username, userData.password,user) if(validateUser === true) { return this.authService.login(user) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index cb9e3a4..d4a9d4d 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,11 +1,16 @@ +import { PrismaService } from './../prisma.service'; import { UserService } from './../user/user.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; +import { UserRepository } from '../../database/repositories/user'; + +const prisma = new PrismaService() +const prismaUser = new UserRepository(prisma) @Injectable() export class AuthService { - constructor(private jwtService: JwtService, private userService: UserService) {} + constructor(private jwtService: JwtService) {} async validateUser(username: string, password: string, user: any ): Promise { const passwordCheck = await bcrypt.compare(password, user.password); @@ -30,7 +35,7 @@ export class AuthService { const userRegData = {"email": regData.email, "username" : regData.username, "passwordhash":passwordhash} - const user = await this.userService.addUser(userRegData) + const user = await prismaUser.add(userRegData) return user } } diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 2b3b7b3..939974f 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -7,10 +7,10 @@ const user = new UserRepository(prisma); @Injectable() export class UserService { - async addUser(regData) { - const newUser = await user.add(regData) - return newUser - } + // async addUser(regData) { + // const newUser = await user.add(regData) + // return newUser + // } async findUser(username) { const specificUser = await user.find(username) return specificUser From 8990254b2ee0c5731b3468a0536bb2135c45fcb0 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 03:00:51 +0200 Subject: [PATCH 22/78] remove unused cope pieces --- src/server/auth/auth.service.ts | 1 - src/server/recipes/dto/recipe.dto.ts | 4 ++-- src/server/recipes/recipe.controller.ts | 21 +++++++-------------- src/server/recipes/recipe.service.ts | 4 +--- src/server/user/user.controller.ts | 6 +++++- src/server/user/user.service.ts | 9 --------- 6 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index d4a9d4d..0096abe 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,5 +1,4 @@ import { PrismaService } from './../prisma.service'; -import { UserService } from './../user/user.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; diff --git a/src/server/recipes/dto/recipe.dto.ts b/src/server/recipes/dto/recipe.dto.ts index 91d13a2..9ff1e04 100644 --- a/src/server/recipes/dto/recipe.dto.ts +++ b/src/server/recipes/dto/recipe.dto.ts @@ -1,8 +1,8 @@ export class CreateRecipeDto { readonly name; - readonly category_id; + readonly categoryId; readonly products; readonly desription; - readonly image_link + readonly imageLink ; } \ No newline at end of file diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 442a69b..0783337 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -2,28 +2,21 @@ import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/commo import { CreateRecipeDto } from "./dto/recipe.dto"; import { RecipeService } from "./recipe.service"; -@Controller("/api") +@Controller("/recipes") export class RecipeController { constructor(private recipeService : RecipeService) {} - @Post('/recipes') - addRecipe(@Body() dto: CreateRecipeDto) { + @Post() + addRecipe(@Body() dto: CreateRecipeDto) { return this.recipeService.addRecipe(dto); } - @Get('/recipes/allrecipes') + @Get('/allrecipes') getAllRecipes() { return this.recipeService.getAllRecipes() } - @Get('/recipes') - getRecipeByName(@Query('recipeName') recipeName : string) { - return this.recipeService.getRecipeByName(recipeName) - } - - @Get('/user/recipes') - getRecipeById(@Query('recipeId') recipeId : number) { - return this.recipeService.getRecipeById(recipeId) + @Get() + getRecipeByName(@Body() recipe) { + return this.recipeService.getRecipeByName(recipe.name) } } - - diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 79f2ecc..ec25647 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,4 +1,3 @@ -import { RecipeModule } from './recipe.module'; import {Injectable} from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; @@ -14,7 +13,7 @@ export class RecipeService { async addRecipe (dto : CreateRecipeDto ) { const newRecipe = await recipe.add(dto) return newRecipe - + } async getRecipeById (id) { @@ -28,7 +27,6 @@ export class RecipeService { return recipes } - async getRecipeByName(recipeName) { const recipeByName = await recipe.search(recipeName) return recipeByName diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index ba72764..f96bccc 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,3 +1,4 @@ +import { PrismaService } from './../prisma.service'; import { RecipeService } from './../recipes/recipe.service'; import { @@ -15,8 +16,11 @@ import { import { UserService } from './user.service'; import { AuthService } from 'auth/auth.service'; import { JwtAuthGuard } from 'auth/jwt-auth.guard'; +import { RecipeRepository } from '../../database/repositories/recipe'; +const prisma = new PrismaService(); +const recipe = new RecipeRepository(prisma); -@Controller('/user/recipes') +@Controller('/user') export class UserController { constructor( private userService : UserService, private authService: AuthService, private recipeService : RecipeService) {} diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 939974f..1933ec9 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -7,15 +7,6 @@ const user = new UserRepository(prisma); @Injectable() export class UserService { - // async addUser(regData) { - // const newUser = await user.add(regData) - // return newUser - // } - async findUser(username) { - const specificUser = await user.find(username) - return specificUser - } - async addRecipe(recipeData) { const userFavRecipe = await user.addRecipe(recipeData) return userFavRecipe From a6abe152f1fbd094e99c88945f0a618aa3be92fc Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 03:11:41 +0200 Subject: [PATCH 23/78] linter --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a18842e..e03d8e7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "chalk": "^5.0.0", "cheerio": "^1.0.0-rc.10", "dotenv": "^10.0.0", - "eslint": "^8.6.0", "express": "^4.17.2", "express-validator": "^6.14.0", "jsonwebtoken": "^9.0.0", @@ -36,6 +35,9 @@ "@types/bcrypt": "^5.0.0", "@types/passport-jwt": "^3.0.8", "@types/passport-local": "^1.0.35", + "@typescript-eslint/eslint-plugin": "^5.48.1", + "@typescript-eslint/parser": "^5.48.1", + "eslint": "^8.31.0", "prisma": "^4.8.1" } } From 27d91f5ece7a60d75f33fa1f449c0aa93dfb92a3 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:38:23 +0200 Subject: [PATCH 24/78] Delete submodule --- src/test-server | 1 - 1 file changed, 1 deletion(-) delete mode 160000 src/test-server diff --git a/src/test-server b/src/test-server deleted file mode 160000 index 3558fac..0000000 --- a/src/test-server +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3558facef1c7365137e19660dc9b34f08d473830 From 5a75317a198376f0eccfe4075f42958489c3e548 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:38:36 +0200 Subject: [PATCH 25/78] Add .idea to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2347d50..7ce88b4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ src/api/package.json src/database/prisma/migrations src/server/dist src/.env +.idea/ From 28e521c954a7f65263b62aefbcd884b2de23c96c Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:40:19 +0200 Subject: [PATCH 26/78] Fix eslint --- .eslintrc.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index efe0ddb..e714645 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,6 @@ "node": true }, "extends": ["eslint:recommended"], - "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module" From f6afcd9e2cefecbb596807902661119359d57cac Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:41:09 +0200 Subject: [PATCH 27/78] Delete useless code --- src/server/app.module.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 174a51f..2b651c5 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -1,20 +1,5 @@ -// import { Module } from '@nestjs/common'; -// import { UserController } from './user.controller'; -// import { PrismaService } from './prisma.service' - -// @Module({ -// imports: [], -// controllers: [UserController], -// providers: [PrismaService], -// }) -// export class AppModule {} - - - - import {Module} from "@nestjs/common"; import { RecipeModule } from './recipes/recipe.module'; -import { PrismaService } from './prisma.service' import { UserModule } from "user/user.module"; import { AuthModule } from "auth/auth.module"; From bbacdf2974ed7db3cb1f9a1acca0019c32bdecc6 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 17:46:14 +0200 Subject: [PATCH 28/78] recipeService now works with json file from parser --- src/server/recipes/recipe.controller.ts | 16 ++++++++++++++++ src/server/recipes/recipe.service.ts | 19 ++++++++++++++++--- src/server/recipes/recipeCategories.ts | 20 ++++++++++++++++++++ src/server/tsconfig.json | 3 ++- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/server/recipes/recipeCategories.ts diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 0783337..4dfda1f 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,6 +1,10 @@ import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/common"; import { CreateRecipeDto } from "./dto/recipe.dto"; import { RecipeService } from "./recipe.service"; +const recipeCategories = require('./recipeCategories') +import * as jsonRecipes from '../../parser/data/recipes.json' + + @Controller("/recipes") export class RecipeController { @@ -19,4 +23,16 @@ export class RecipeController { getRecipeByName(@Body() recipe) { return this.recipeService.getRecipeByName(recipe.name) } + + @Post('/categories') + addCategories(recipesObject) { + recipesObject = recipeCategories + return this.recipeService.addRecipeCategoriesToDb(recipesObject) + } + + @Post('/addRecipes') + addRecipes(recipes) { + recipes = jsonRecipes + return this.recipeService.addParsedRecipesToDb(recipes) + } } diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index ec25647..9cd136c 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,12 +1,13 @@ +import { CategoryRepository } from '../../database/repositories/category'; import {Injectable} from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; import { PrismaService } from '.././prisma.service'; import { RecipeRepository } from '../../database/repositories/recipe'; - - +const recipeCategories = require('./recipeCategories') const prisma = new PrismaService(); const recipe = new RecipeRepository(prisma); +const categories = new CategoryRepository(prisma) @Injectable() export class RecipeService { @@ -19,7 +20,6 @@ export class RecipeService { async getRecipeById (id) { const recipeById = await recipe.find(id) return recipeById - } async getAllRecipes () { @@ -31,5 +31,18 @@ export class RecipeService { const recipeByName = await recipe.search(recipeName) return recipeByName } + + async addRecipeCategoriesToDb(recipesArray) { + for(let i = 0 ; i < Object.keys(recipesArray).length; i++){ + await categories.add(Object.keys(recipesArray)[i]) + } + } + + async addParsedRecipesToDb(jsonRecipes){ + for(const el of jsonRecipes){ + el.categoryId = recipeCategories.recipeCategories[el.categoryId] + await this.addRecipe(el) + } + } } diff --git a/src/server/recipes/recipeCategories.ts b/src/server/recipes/recipeCategories.ts new file mode 100644 index 0000000..e479244 --- /dev/null +++ b/src/server/recipes/recipeCategories.ts @@ -0,0 +1,20 @@ +const recipeCategories = { + "Бульоны и супы": 1, + "Горячие блюда": 2, + "Салаты": 3, + "Закуски": 4, + "Напитки": 5, + "Соусы": 6, + "Выпечка": 7, + "Десерты": 8, + "Заготовки": 9, + "Блюда из лаваша": 10, + "Готовим в аэрогриле": 11, + "Каши": 12, + "Украшения для блюд": 13, + "Готовим в пароварке": 14, + "Приготовление молочных продуктов": 15, + "Готовим в мультиварке": 16, + "Маринад, панировка": 17, +}; +export {recipeCategories} \ No newline at end of file diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json index ac4d2a8..7d55d86 100644 --- a/src/server/tsconfig.json +++ b/src/server/tsconfig.json @@ -18,6 +18,7 @@ "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, - "noFallthroughCasesInSwitch": false + "noFallthroughCasesInSwitch": false, + "resolveJsonModule":true } } From b8b4bfb1504888a7bb1bd8fa9689662bcfccfd37 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:49:27 +0200 Subject: [PATCH 29/78] Created proper eslint config for nest --- package.json | 3 + src/server/.eslintrc.js | 173 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 src/server/.eslintrc.js diff --git a/package.json b/package.json index a18842e..da70cc3 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,9 @@ "@types/bcrypt": "^5.0.0", "@types/passport-jwt": "^3.0.8", "@types/passport-local": "^1.0.35", + "@typescript-eslint/eslint-plugin": "^5.48.1", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-prettier": "^4.2.1", "prisma": "^4.8.1" } } diff --git a/src/server/.eslintrc.js b/src/server/.eslintrc.js new file mode 100644 index 0000000..3e1adf7 --- /dev/null +++ b/src/server/.eslintrc.js @@ -0,0 +1,173 @@ +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: __dirname, + sourceType: 'module', + }, + plugins: ['@typescript-eslint/eslint-plugin'], + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + ], + root: true, + env: { + node: true, + jest: true, + }, + ignorePatterns: ['.eslintrc.js'], + rules: { + "indent": ["error", 2], + "linebreak-style": ["error", "unix"], + "quotes": [ + "error", + "single", + { + "allowTemplateLiterals": true + } + ], + "semi": ["error", "always"], + "no-loop-func": ["error"], + "block-spacing": ["error", "always"], + "camelcase": [ + "error", + { "allow": ["user_id", "recipe_id", "category_id", "image_link"] } + ], + "eqeqeq": ["error", "always"], + "strict": ["error", "global"], + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } + ], + "comma-style": ["error", "last"], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "eol-last": ["error"], + "func-call-spacing": ["error", "never"], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true, + "mode": "minimum" + } + ], + "keyword-spacing": [ + "error", + { + "before": true, + "after": true, + "overrides": { + "function": { + "after": false + } + } + } + ], + "max-len": [ + "error", + { + "code": 80, + "ignoreUrls": true + } + ], + "max-nested-callbacks": [ + "error", + { + "max": 7 + } + ], + "new-cap": [ + "error", + { + "newIsCap": true, + "capIsNew": false, + "properties": true + } + ], + "new-parens": ["error"], + "no-lonely-if": ["error"], + "no-trailing-spaces": ["error"], + "no-unneeded-ternary": ["error"], + "no-whitespace-before-property": ["error"], + "object-curly-spacing": ["error", "always"], + "operator-assignment": ["error", "always"], + "operator-linebreak": ["error", "after"], + "semi-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": [ + "error", + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + } + ], + "space-in-parens": ["error", "never"], + "space-infix-ops": ["error"], + "space-unary-ops": [ + "error", + { + "words": true, + "nonwords": false, + "overrides": { + "typeof": false + } + } + ], + "no-unreachable": ["error"], + "no-global-assign": ["error"], + "no-self-compare": ["error"], + "no-unmodified-loop-condition": ["error"], + "no-constant-condition": [ + "error", + { + "checkLoops": false + } + ], + "no-console": ["off"], + "no-useless-concat": ["error"], + "no-useless-escape": ["error"], + "no-shadow-restricted-names": ["error"], + "no-use-before-define": [ + "error", + { + "functions": false + } + ], + "arrow-parens": ["error", "as-needed"], + "arrow-body-style": ["error", "as-needed"], + "arrow-spacing": ["error"], + "no-confusing-arrow": [ + "error", + { + "allowParens": true + } + ], + "no-useless-computed-key": ["error"], + "no-useless-rename": ["error"], + "no-var": ["error"], + "object-shorthand": ["error", "always"], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-numeric-literals": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "rest-spread-spacing": ["error", "never"], + "template-curly-spacing": ["error", "never"] + }, +}; From 49c68649f92f2faa2573e229e86e8966fc796994 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:49:43 +0200 Subject: [PATCH 30/78] Delete unused config --- .eslintrc.json | 166 ------------------------------------------------- 1 file changed, 166 deletions(-) delete mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e714645..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": ["eslint:recommended"], - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "rules": { - "indent": ["error", 2], - "linebreak-style": ["error", "unix"], - "quotes": [ - "error", - "single", - { - "allowTemplateLiterals": true - } - ], - "semi": ["error", "always"], - "no-loop-func": ["error"], - "block-spacing": ["error", "always"], - "camelcase": [ - "error", - { "allow": ["user_id", "recipe_id", "category_id", "image_link"] } - ], - "eqeqeq": ["error", "always"], - "strict": ["error", "global"], - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "comma-style": ["error", "last"], - "comma-spacing": [ - "error", - { - "before": false, - "after": true - } - ], - "eol-last": ["error"], - "func-call-spacing": ["error", "never"], - "key-spacing": [ - "error", - { - "beforeColon": false, - "afterColon": true, - "mode": "minimum" - } - ], - "keyword-spacing": [ - "error", - { - "before": true, - "after": true, - "overrides": { - "function": { - "after": false - } - } - } - ], - "max-len": [ - "error", - { - "code": 80, - "ignoreUrls": true - } - ], - "max-nested-callbacks": [ - "error", - { - "max": 7 - } - ], - "new-cap": [ - "error", - { - "newIsCap": true, - "capIsNew": false, - "properties": true - } - ], - "new-parens": ["error"], - "no-lonely-if": ["error"], - "no-trailing-spaces": ["error"], - "no-unneeded-ternary": ["error"], - "no-whitespace-before-property": ["error"], - "object-curly-spacing": ["error", "always"], - "operator-assignment": ["error", "always"], - "operator-linebreak": ["error", "after"], - "semi-spacing": [ - "error", - { - "before": false, - "after": true - } - ], - "space-before-blocks": ["error", "always"], - "space-before-function-paren": [ - "error", - { - "anonymous": "never", - "named": "never", - "asyncArrow": "always" - } - ], - "space-in-parens": ["error", "never"], - "space-infix-ops": ["error"], - "space-unary-ops": [ - "error", - { - "words": true, - "nonwords": false, - "overrides": { - "typeof": false - } - } - ], - "no-unreachable": ["error"], - "no-global-assign": ["error"], - "no-self-compare": ["error"], - "no-unmodified-loop-condition": ["error"], - "no-constant-condition": [ - "error", - { - "checkLoops": false - } - ], - "no-console": ["off"], - "no-useless-concat": ["error"], - "no-useless-escape": ["error"], - "no-shadow-restricted-names": ["error"], - "no-use-before-define": [ - "error", - { - "functions": false - } - ], - "arrow-parens": ["error", "as-needed"], - "arrow-body-style": ["error", "as-needed"], - "arrow-spacing": ["error"], - "no-confusing-arrow": [ - "error", - { - "allowParens": true - } - ], - "no-useless-computed-key": ["error"], - "no-useless-rename": ["error"], - "no-var": ["error"], - "object-shorthand": ["error", "always"], - "prefer-arrow-callback": ["error"], - "prefer-const": ["error"], - "prefer-numeric-literals": ["error"], - "prefer-rest-params": ["error"], - "prefer-spread": ["error"], - "rest-spread-spacing": ["error", "never"], - "template-curly-spacing": ["error", "never"] - } -} From c3adf105410a02ca53a1913dec91173d3bff7994 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:54:12 +0200 Subject: [PATCH 31/78] ESLint fix --- src/server/app.module.ts | 8 ++-- src/server/auth/auth.controller.ts | 16 ++++--- src/server/auth/auth.module.ts | 31 ++++++------- src/server/auth/auth.service.ts | 34 ++++++++------ src/server/auth/jwt-auth.guard.ts | 6 +-- src/server/auth/jwt.strategy.ts | 28 ++++++------ src/server/prisma.service.ts | 13 +++--- src/server/recipes/recipe.controller.ts | 61 +++++++++++-------------- src/server/recipes/recipe.dto.ts | 13 +++--- src/server/recipes/recipe.module.ts | 5 +- src/server/recipes/recipe.service.ts | 29 ++++-------- src/server/user/user.controller.ts | 49 ++++++++++---------- src/server/user/user.module.ts | 20 ++++---- src/server/user/user.service.ts | 39 +++++++--------- 14 files changed, 163 insertions(+), 189 deletions(-) diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 2b651c5..c07a86c 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -1,9 +1,9 @@ -import {Module} from "@nestjs/common"; +import { Module } from '@nestjs/common'; import { RecipeModule } from './recipes/recipe.module'; -import { UserModule } from "user/user.module"; -import { AuthModule } from "auth/auth.module"; +import { UserModule } from 'user/user.module'; +import { AuthModule } from 'auth/auth.module'; @Module({ - imports: [RecipeModule,UserModule,AuthModule] + imports: [RecipeModule, UserModule, AuthModule], }) export class AppModule {} diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 8abc189..d712b3d 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,11 +1,13 @@ - -import { UserService } from './../user/user.service'; +import { UserService } from '../user/user.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; @Controller('auth') export class AuthController { - constructor(private authService: AuthService, private userService : UserService) {} + constructor( + private authService: AuthService, + private userService: UserService + ) {} @Post('/registration') async addUser(@Body() regData) { @@ -14,8 +16,8 @@ export class AuthController { @Post('/login') async login(@Body() userData) { - const user = await this.userService.findUser(userData.username) - await this.authService.validateUser(user.username, user.password) - return this.authService.login(user) -} + const user = await this.userService.findUser(userData.username); + await this.authService.validateUser(user.username, user.password); + return this.authService.login(user); + } } diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index 43a56e1..5d1a6f1 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,22 +1,21 @@ -import { UserService } from './../user/user.service'; +import { UserService } from '../user/user.service'; import { JwtStrategy } from './jwt.strategy'; -import { Module } from "@nestjs/common"; -import {AuthService} from './auth.service' +import { Module } from '@nestjs/common'; +import { AuthService } from './auth.service'; import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { AuthController } from './auth.controller'; @Module({ - imports: [ - PassportModule, - JwtModule.register({ - secret: process.env.JWT_SECRET_KEY, - signOptions: { expiresIn: '3660s' }, - }), - ], - providers: [AuthService, JwtStrategy,UserService], - controllers: [AuthController], - exports: [AuthService], - }) - export class AuthModule {} - \ No newline at end of file + imports: [ + PassportModule, + JwtModule.register({ + secret: process.env.JWT_SECRET_KEY, + signOptions: { expiresIn: '3660s' }, + }), + ], + providers: [AuthService, JwtStrategy, UserService], + controllers: [AuthController], + exports: [AuthService], +}) +export class AuthModule {} diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 0633ecb..a8e044d 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,16 +1,19 @@ -import { UserService } from './../user/user.service'; +import { UserService } from '../user/user.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; @Injectable() export class AuthService { - constructor(private jwtService: JwtService, private userService: UserService) {} + constructor( + private jwtService: JwtService, + private userService: UserService + ) {} async validateUser(username: string, password: string): Promise { const user = await this.userService.findUser(username); console.log(user); - + if (user && user.password === password) { return user; } @@ -18,21 +21,22 @@ export class AuthService { } async login(user) { - if(!user) { - throw new BadRequestException('invalid user') - } - const payload = { username: user.username, id: user.id }; - return { - access_token: this.jwtService.sign(payload) + if (!user) { + throw new BadRequestException('invalid user'); + } + const payload = { username: user.username, id: user.id }; + return { + accessToken: this.jwtService.sign(payload), }; } async register(regData) { - const passwordhash = await bcrypt.hash(regData.password,12) - const userRegData = {"email": regData.email, - "username" : regData.username, - "passwordhash":passwordhash} - const user = await this.userService.addUser(userRegData) - return user + const passwordHash = await bcrypt.hash(regData.password, 12); + const userRegData = { + email: regData.email, + username: regData.username, + passwordHash, + }; + return await this.userService.addUser(userRegData); } } diff --git a/src/server/auth/jwt-auth.guard.ts b/src/server/auth/jwt-auth.guard.ts index 6af748c..2155290 100644 --- a/src/server/auth/jwt-auth.guard.ts +++ b/src/server/auth/jwt-auth.guard.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { AuthGuard } from "@nestjs/passport"; +import { Injectable } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; @Injectable() -export class JwtAuthGuard extends AuthGuard('jwt') {} \ No newline at end of file +export class JwtAuthGuard extends AuthGuard('jwt') {} diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/jwt.strategy.ts index 445ab24..a610692 100644 --- a/src/server/auth/jwt.strategy.ts +++ b/src/server/auth/jwt.strategy.ts @@ -1,18 +1,18 @@ -import { Injectable } from "@nestjs/common"; -import { PassportStrategy } from "@nestjs/passport"; -import { ExtractJwt, Strategy} from 'passport-jwt' +import { Injectable } from '@nestjs/common'; +import { PassportStrategy } from '@nestjs/passport'; +import { ExtractJwt, Strategy } from 'passport-jwt'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy) { - constructor() { - super({ - jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), - secretOrKey: process.env.JWT_SECRET_KEY - }) - } - async validate(payload) { - return { - userId : payload.id - } - } + constructor() { + super({ + jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), + secretOrKey: process.env.JWT_SECRET_KEY, + }); + } + async validate(payload) { + return { + userId: payload.id, + }; + } } diff --git a/src/server/prisma.service.ts b/src/server/prisma.service.ts index a5dfac1..154c9ec 100644 --- a/src/server/prisma.service.ts +++ b/src/server/prisma.service.ts @@ -1,16 +1,15 @@ -import { Injectable, OnModuleInit, INestApplication } from '@nestjs/common' -import { PrismaClient } from '@prisma/client' - +import { Injectable, OnModuleInit, INestApplication } from '@nestjs/common'; +import { PrismaClient } from '@prisma/client'; @Injectable() export class PrismaService extends PrismaClient implements OnModuleInit { async onModuleInit() { - await this.$connect() + await this.$connect(); } async enableShutdownHooks(app: INestApplication) { this.$on('beforeExit', async () => { - await app.close() - }) + await app.close(); + }); } -} \ No newline at end of file +} diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 37d4001..db88ce9 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,38 +1,29 @@ -import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/common"; -import { CreateRecipeDto } from "./recipe.dto"; -import { RecipeService } from "./recipe.service"; +import { Body, Controller, Get, Post, Query } from '@nestjs/common'; +import { CreateRecipeDto } from './recipe.dto'; +import { RecipeService } from './recipe.service'; -@Controller("/api") +@Controller('/api') export class RecipeController { - constructor(private recipeService : RecipeService) {} - @Post('/recipes') - addRecipe(@Body() dto: CreateRecipeDto) { - console.log(dto); - - return this.recipeService.addRecipe(dto); - } - - @Get('/recipes/allrecipes') - getAllRecipes() { - return this.recipeService.getAllRecipes() - } - - @Get('/recipes') - getRecipeByName(@Query('recipeName') recipeName : string) { - return this.recipeService.getRecipeByName(recipeName) - } - - @Get('/user/recipes') - getRecipeById(@Query('recipeId') recipeId : number) { - return this.recipeService.getRecipeById(recipeId) - } - - // @Post('/user/recipes') - // addFavRecipe(@Body()) {} - - getFavRecipes() {} - - deleteFavRecipe() {} + constructor(private recipeService: RecipeService) {} + @Post('/recipes') + addRecipe(@Body() dto: CreateRecipeDto) { + console.log(dto); + + return this.recipeService.addRecipe(dto); + } + + @Get('/recipes/all-recipes') + getAllRecipes() { + return this.recipeService.getAllRecipes(); + } + + @Get('/recipes') + getRecipeByName(@Query('recipeName') recipeName: string) { + return this.recipeService.getRecipeByName(recipeName); + } + + @Get('/user/recipes') + getRecipeById(@Query('recipeId') recipeId: number) { + return this.recipeService.getRecipeById(recipeId); + } } - - diff --git a/src/server/recipes/recipe.dto.ts b/src/server/recipes/recipe.dto.ts index 91d13a2..bdee832 100644 --- a/src/server/recipes/recipe.dto.ts +++ b/src/server/recipes/recipe.dto.ts @@ -1,8 +1,7 @@ export class CreateRecipeDto { - readonly name; - readonly category_id; - readonly products; - readonly desription; - readonly image_link - } - \ No newline at end of file + readonly name; + readonly category_id; + readonly products; + readonly desription; + readonly image_link; +} diff --git a/src/server/recipes/recipe.module.ts b/src/server/recipes/recipe.module.ts index 9607b57..2af395f 100644 --- a/src/server/recipes/recipe.module.ts +++ b/src/server/recipes/recipe.module.ts @@ -1,10 +1,9 @@ -import {Module} from "@nestjs/common"; +import { Module } from '@nestjs/common'; import { RecipeController } from './recipe.controller'; import { RecipeService } from './recipe.service'; @Module({ controllers: [RecipeController], - providers: [RecipeService] + providers: [RecipeService], }) - export class RecipeModule {} diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 9d65771..a7d5da3 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,38 +1,27 @@ -import { RecipeModule } from './recipe.module'; -import {Injectable} from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from './recipe.dto'; -import { PrismaService } from '.././prisma.service'; -// import { recipes as RecipeModel, Prisma } from '@prisma/client'; +import { PrismaService } from '../prisma.service'; import { RecipeRepository } from '../../database/repositories/recipe'; - const prisma = new PrismaService(); const recipe = new RecipeRepository(prisma); @Injectable() export class RecipeService { - async addRecipe (dto : CreateRecipeDto ) { - const newRecipe = await recipe.add(dto) - return newRecipe - + async addRecipe(dto: CreateRecipeDto) { + return await recipe.add(dto); } - async getRecipeById (id) { - const recipeById = await recipe.find(id) - return recipeById - + async getRecipeById(id) { + return await recipe.find(id); } - async getAllRecipes () { - const recipes = await recipe.findAll() - return recipes - + async getAllRecipes() { + return await recipe.findAll(); } async getRecipeByName(recipeName) { - const recipeByName = await recipe.search(recipeName) - return recipeByName + return await recipe.search(recipeName); } } - diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 564606b..5829bcd 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,16 +1,12 @@ -import { RecipeService } from './../recipes/recipe.service'; +import { RecipeService } from '../recipes/recipe.service'; import { Controller, Get, - Param, Post, - Body, - Put, Delete, - Query, UseGuards, - Request + Request, } from '@nestjs/common'; import { UserService } from './user.service'; import { AuthService } from 'auth/auth.service'; @@ -18,40 +14,41 @@ import { JwtAuthGuard } from 'auth/jwt-auth.guard'; @Controller('/user/recipes') export class UserController { - constructor( private userService : UserService, private authService: AuthService, - private recipeService : RecipeService) {} + constructor( + private userService: UserService, + private authService: AuthService, + private recipeService: RecipeService + ) {} @UseGuards(JwtAuthGuard) @Post() addFavRecipe(@Request() req) { - const userId = req.user.userId - const recipeId = req.body.recipeId - - const recipeData = {"userId" : userId, "recipeId" : recipeId} - return this.userService.addRecipe(recipeData) + const userId = req.user.userId; + const recipeId = req.body.recipeId; + + const recipeData = { userId, recipeId }; + return this.userService.addRecipe(recipeData); } @UseGuards(JwtAuthGuard) @Get() async getFavRecipes(@Request() req) { - const userId = req.user.userId - const recipesId = await this.userService.getRecipes(userId) - let favRecipes = [] - for(let el of recipesId){ - favRecipes.push(await this.recipeService.getRecipeById(el)) + const userId = req.user.userId; + const recipesId = await this.userService.getRecipes(userId); + const favRecipes = []; + for (const el of recipesId) { + favRecipes.push(await this.recipeService.getRecipeById(el)); } - return favRecipes + return favRecipes; } @UseGuards(JwtAuthGuard) @Delete() deleteFavRecipe(@Request() req) { - const userId = req.user.userId - const recipeId = req.body.recipeId - - const recipeData = {"userId" : userId, "recipeId" : recipeId} - return this.userService.deleteRecipe(recipeData) - } - + const userId = req.user.userId; + const recipeId = req.body.recipeId; + const recipeData = { userId, recipeId }; + return this.userService.deleteRecipe(recipeData); + } } diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index adc4a5c..59b4dbc 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -1,14 +1,14 @@ -import { RecipeService } from './../recipes/recipe.service'; -import { JwtStrategy } from './../auth/jwt.strategy'; +import { RecipeService } from '../recipes/recipe.service'; +import { JwtStrategy } from '../auth/jwt.strategy'; import { JwtService } from '@nestjs/jwt'; -import { Module } from "@nestjs/common"; -import { AuthService } from "auth/auth.service"; -import { UserController } from "./user.controller"; -import {UserService} from './user.service' +import { Module } from '@nestjs/common'; +import { AuthService } from 'auth/auth.service'; +import { UserController } from './user.controller'; +import { UserService } from './user.service'; @Module({ - providers: [UserService,AuthService,JwtService,JwtStrategy,RecipeService], - exports: [UserService], - controllers:[UserController] + providers: [UserService, AuthService, JwtService, JwtStrategy, RecipeService], + exports: [UserService], + controllers: [UserController], }) -export class UserModule{} \ No newline at end of file +export class UserModule {} diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index a671cae..8b4aaff 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from "@nestjs/common"; +import { Injectable } from '@nestjs/common'; import { PrismaService } from '.././prisma.service'; import { UserRepository } from '../../database/repositories/user'; @@ -8,27 +8,22 @@ const user = new UserRepository(prisma); @Injectable() export class UserService { - async addUser(regData) { - const newUser = await user.add(regData) - return newUser - } - async findUser(username) { - const specificUser = await user.find(username) - return specificUser - } + async addUser(regData) { + return await user.add(regData); + } + async findUser(username) { + return await user.find(username); + } - async addRecipe(recipeData) { - const userFavRecipe = await user.addRecipe(recipeData) - return userFavRecipe - } + async addRecipe(recipeData) { + return await user.addRecipe(recipeData); + } - async getRecipes(recipeData) { - const userFavRecipes = await user.findRecipes(recipeData) - return userFavRecipes - } + async getRecipes(recipeData) { + return await user.findRecipes(recipeData); + } - async deleteRecipe(recipeData) { - const deleteRecipe = await user.deleteRecipe(recipeData) - return deleteRecipe - } -} \ No newline at end of file + async deleteRecipe(recipeData) { + return await user.deleteRecipe(recipeData); + } +} From bd072f9b29d685b353f36a3e018dec3f890b1650 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:02:45 +0200 Subject: [PATCH 32/78] Fix typo --- src/server/recipes/recipe.dto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/recipes/recipe.dto.ts b/src/server/recipes/recipe.dto.ts index bdee832..5cf1293 100644 --- a/src/server/recipes/recipe.dto.ts +++ b/src/server/recipes/recipe.dto.ts @@ -2,6 +2,6 @@ export class CreateRecipeDto { readonly name; readonly category_id; readonly products; - readonly desription; + readonly description; readonly image_link; } From 18f2fd361e81b9cd8045c9da7090553f28854f8e Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:03:03 +0200 Subject: [PATCH 33/78] Create favouriteRecipe.entity.ts --- src/server/recipes/Entities/favouriteRecipe.entity.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/server/recipes/Entities/favouriteRecipe.entity.ts diff --git a/src/server/recipes/Entities/favouriteRecipe.entity.ts b/src/server/recipes/Entities/favouriteRecipe.entity.ts new file mode 100644 index 0000000..7ba80cd --- /dev/null +++ b/src/server/recipes/Entities/favouriteRecipe.entity.ts @@ -0,0 +1,10 @@ +import { RecipeEntity } from './recipe.entity'; +import { UserEntity } from '../../user/Entities/user.entity'; + +export interface FavouriteRecipeEntity { + id: number; + user_id: number; + recipe_id: number; + recipes?: RecipeEntity[]; + users?: UserEntity[]; +} From 78d0b9f5022aa8bcba50d7fdcd6dfe02b485c43f Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:03:54 +0200 Subject: [PATCH 34/78] Create user.entity.ts --- src/server/user/Entities/user.entity.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/server/user/Entities/user.entity.ts diff --git a/src/server/user/Entities/user.entity.ts b/src/server/user/Entities/user.entity.ts new file mode 100644 index 0000000..2baf191 --- /dev/null +++ b/src/server/user/Entities/user.entity.ts @@ -0,0 +1,9 @@ +import { FavouriteRecipeEntity } from '../../recipes/Entities/favouriteRecipe.entity'; + +export interface UserEntity { + id: number; + username: string; + email: string; + password: string; + favourite_recipes: FavouriteRecipeEntity[]; +} From f45831f1b2015ef85e2bdf5fd78fbfa75460d7b6 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:04:06 +0200 Subject: [PATCH 35/78] Create category.entity.ts --- src/server/recipes/Entities/category,entity.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/server/recipes/Entities/category,entity.ts diff --git a/src/server/recipes/Entities/category,entity.ts b/src/server/recipes/Entities/category,entity.ts new file mode 100644 index 0000000..c3f7eb2 --- /dev/null +++ b/src/server/recipes/Entities/category,entity.ts @@ -0,0 +1,7 @@ +import { RecipeEntity } from './recipe.entity'; + +export interface CategoryEntity { + id: number; + name: string; + recipes?: RecipeEntity[]; +} From 69d5123cc231facd6de907aeb8e2a46f36cab713 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:04:13 +0200 Subject: [PATCH 36/78] Create recipe.entity.ts --- src/server/recipes/Entities/recipe.entity.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/server/recipes/Entities/recipe.entity.ts diff --git a/src/server/recipes/Entities/recipe.entity.ts b/src/server/recipes/Entities/recipe.entity.ts new file mode 100644 index 0000000..e90abaa --- /dev/null +++ b/src/server/recipes/Entities/recipe.entity.ts @@ -0,0 +1,13 @@ +import { FavouriteRecipeEntity } from './favouriteRecipe.entity'; +import { CategoryEntity } from './category,entity'; + +export interface RecipeEntity { + id: number; + name: string; + category_id: number; + products: string; + description: string; + image_link?: string; + favourite_recipes: FavouriteRecipeEntity[]; + categories: CategoryEntity[]; +} From 9c8698b6b68919a1d47b7cbb597b0eb5d8c96d8f Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:04:39 +0200 Subject: [PATCH 37/78] Fix typo --- src/server/recipes/Entities/recipe.entity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/recipes/Entities/recipe.entity.ts b/src/server/recipes/Entities/recipe.entity.ts index e90abaa..0d9f943 100644 --- a/src/server/recipes/Entities/recipe.entity.ts +++ b/src/server/recipes/Entities/recipe.entity.ts @@ -1,5 +1,5 @@ import { FavouriteRecipeEntity } from './favouriteRecipe.entity'; -import { CategoryEntity } from './category,entity'; +import { CategoryEntity } from './category.entity'; export interface RecipeEntity { id: number; From 13095f17d5e914efdd0f61a528d31d4c953828c9 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:14:19 +0200 Subject: [PATCH 38/78] Fix typo --- .../recipes/Entities/{category,entity.ts => category.entity.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/server/recipes/Entities/{category,entity.ts => category.entity.ts} (100%) diff --git a/src/server/recipes/Entities/category,entity.ts b/src/server/recipes/Entities/category.entity.ts similarity index 100% rename from src/server/recipes/Entities/category,entity.ts rename to src/server/recipes/Entities/category.entity.ts From b005ff47e9e914ff1f2cd86be50a0e85de2570af Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:14:49 +0200 Subject: [PATCH 39/78] Move Guard and strategy to JWT folder --- src/server/auth/{ => JWT}/jwt-auth.guard.ts | 0 src/server/auth/{ => JWT}/jwt.strategy.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/server/auth/{ => JWT}/jwt-auth.guard.ts (100%) rename src/server/auth/{ => JWT}/jwt.strategy.ts (100%) diff --git a/src/server/auth/jwt-auth.guard.ts b/src/server/auth/JWT/jwt-auth.guard.ts similarity index 100% rename from src/server/auth/jwt-auth.guard.ts rename to src/server/auth/JWT/jwt-auth.guard.ts diff --git a/src/server/auth/jwt.strategy.ts b/src/server/auth/JWT/jwt.strategy.ts similarity index 100% rename from src/server/auth/jwt.strategy.ts rename to src/server/auth/JWT/jwt.strategy.ts From 0b5c2f3bfeef5194412dd6d3e1f0db1a01b015a9 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:15:12 +0200 Subject: [PATCH 40/78] Delete unnecessary log --- src/server/recipes/recipe.controller.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index db88ce9..2f36ddf 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,5 +1,5 @@ import { Body, Controller, Get, Post, Query } from '@nestjs/common'; -import { CreateRecipeDto } from './recipe.dto'; +import { CreateRecipeDto } from './DTO/recipe.dto'; import { RecipeService } from './recipe.service'; @Controller('/api') @@ -7,8 +7,6 @@ export class RecipeController { constructor(private recipeService: RecipeService) {} @Post('/recipes') addRecipe(@Body() dto: CreateRecipeDto) { - console.log(dto); - return this.recipeService.addRecipe(dto); } From 947d4cd4428287379bd6dd89c8bb58dd48cc959a Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:15:25 +0200 Subject: [PATCH 41/78] Move dto to DTO folder --- src/server/recipes/{ => DTO}/recipe.dto.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/server/recipes/{ => DTO}/recipe.dto.ts (100%) diff --git a/src/server/recipes/recipe.dto.ts b/src/server/recipes/DTO/recipe.dto.ts similarity index 100% rename from src/server/recipes/recipe.dto.ts rename to src/server/recipes/DTO/recipe.dto.ts From a231bd4cf77fdb60ff97d58cd1b854c7e6ab6526 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:15:38 +0200 Subject: [PATCH 42/78] Add type annotation to service --- src/server/recipes/recipe.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index a7d5da3..93ce80c 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { CreateRecipeDto } from './recipe.dto'; +import { CreateRecipeDto } from './DTO/recipe.dto'; import { PrismaService } from '../prisma.service'; import { RecipeRepository } from '../../database/repositories/recipe'; +import { RecipeEntity } from './Entities/recipe.entity'; const prisma = new PrismaService(); const recipe = new RecipeRepository(prisma); @@ -13,15 +14,15 @@ export class RecipeService { return await recipe.add(dto); } - async getRecipeById(id) { + async getRecipeById(id): Promise { return await recipe.find(id); } - async getAllRecipes() { + async getAllRecipes(): Promise { return await recipe.findAll(); } - async getRecipeByName(recipeName) { + async getRecipeByName(recipeName): Promise { return await recipe.search(recipeName); } } From 1d4da05b93639f4a6d890fedd1b20fc4a42efa3e Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:16:01 +0200 Subject: [PATCH 43/78] JWT move refactor --- src/server/user/user.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 5829bcd..12d9cf1 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -10,7 +10,7 @@ import { } from '@nestjs/common'; import { UserService } from './user.service'; import { AuthService } from 'auth/auth.service'; -import { JwtAuthGuard } from 'auth/jwt-auth.guard'; +import { JwtAuthGuard } from 'auth/JWT/jwt-auth.guard'; @Controller('/user/recipes') export class UserController { From f86d194d3d659b81edf007de4027426570043cc0 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:16:12 +0200 Subject: [PATCH 44/78] Create userDto for auth --- src/server/auth/DTO/user.dto.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/server/auth/DTO/user.dto.ts diff --git a/src/server/auth/DTO/user.dto.ts b/src/server/auth/DTO/user.dto.ts new file mode 100644 index 0000000..300f47f --- /dev/null +++ b/src/server/auth/DTO/user.dto.ts @@ -0,0 +1,4 @@ +export class CreateUserDto { + readonly username: string; + readonly password: string; +} From 33891f65f295439593a55e3ba6d8c179ead9f3e0 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:16:32 +0200 Subject: [PATCH 45/78] JWT move refactor --- src/server/user/user.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index 59b4dbc..0223198 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -1,5 +1,5 @@ import { RecipeService } from '../recipes/recipe.service'; -import { JwtStrategy } from '../auth/jwt.strategy'; +import { JwtStrategy } from '../auth/JWT/jwt.strategy'; import { JwtService } from '@nestjs/jwt'; import { Module } from '@nestjs/common'; import { AuthService } from 'auth/auth.service'; From f2c5ff4cb910c227ab7bb5bd5a5466f9816d4102 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:16:50 +0200 Subject: [PATCH 46/78] Added type annotations --- src/server/user/user.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 8b4aaff..243f502 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,7 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { PrismaService } from '.././prisma.service'; +import { PrismaService } from '../prisma.service'; import { UserRepository } from '../../database/repositories/user'; +import { UserEntity } from './Entities/user.entity'; +import { FavouriteRecipeEntity } from '../recipes/Entities/favouriteRecipe.entity'; const prisma = new PrismaService(); const user = new UserRepository(prisma); @@ -11,7 +13,7 @@ export class UserService { async addUser(regData) { return await user.add(regData); } - async findUser(username) { + async findUser(username): Promise { return await user.find(username); } @@ -19,7 +21,7 @@ export class UserService { return await user.addRecipe(recipeData); } - async getRecipes(recipeData) { + async getRecipes(recipeData): Promise { return await user.findRecipes(recipeData); } From 501aa05fb0924aa73f828df3c54739fb1c980fa3 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:17:15 +0200 Subject: [PATCH 47/78] Added DTOs and entities to code --- src/server/auth/auth.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index a8e044d..3c8212f 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -2,6 +2,8 @@ import { UserService } from '../user/user.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; +import { UserEntity } from '../user/Entities/user.entity'; +import { CreateUserDto } from './DTO/user.dto'; @Injectable() export class AuthService { @@ -10,17 +12,15 @@ export class AuthService { private userService: UserService ) {} - async validateUser(username: string, password: string): Promise { - const user = await this.userService.findUser(username); - console.log(user); - - if (user && user.password === password) { + async validateUser(userDto: CreateUserDto): Promise { + const user = await this.userService.findUser(userDto.username); + if (user && user.password === userDto.password) { return user; } return null; } - async login(user) { + async login(user: UserEntity) { if (!user) { throw new BadRequestException('invalid user'); } From c8c92078552a9368d33cb7d29f741707005266a2 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:17:29 +0200 Subject: [PATCH 48/78] JWT move refactor --- src/server/auth/auth.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index 5d1a6f1..a46fbca 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -1,5 +1,5 @@ import { UserService } from '../user/user.service'; -import { JwtStrategy } from './jwt.strategy'; +import { JwtStrategy } from './JWT/jwt.strategy'; import { Module } from '@nestjs/common'; import { AuthService } from './auth.service'; import { PassportModule } from '@nestjs/passport'; From 5d25cd0a19fc6a6f18abc4f37cba6798b5ff1642 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:18:02 +0200 Subject: [PATCH 49/78] Refactored login route and added dtos --- src/server/auth/auth.controller.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index d712b3d..d530bff 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,23 +1,19 @@ -import { UserService } from '../user/user.service'; import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; +import { CreateUserDto } from './DTO/user.dto'; @Controller('auth') export class AuthController { - constructor( - private authService: AuthService, - private userService: UserService - ) {} + constructor(private authService: AuthService) {} @Post('/registration') - async addUser(@Body() regData) { + async addUser(@Body() regData: CreateUserDto) { return await this.authService.register(regData); } @Post('/login') - async login(@Body() userData) { - const user = await this.userService.findUser(userData.username); - await this.authService.validateUser(user.username, user.password); - return this.authService.login(user); + async login(@Body() userData: CreateUserDto) { + const validatedUser = await this.authService.validateUser(userData); + return this.authService.login(validatedUser); } } From fa7286fb5105df10658f804f7f94964bd4d45135 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 18:20:04 +0200 Subject: [PATCH 50/78] created dto for log and reg to validate input data --- package.json | 2 ++ src/server/auth/auth.controller.ts | 15 +++++++++------ src/server/auth/auth.service.ts | 11 +++++------ src/server/user/dto/login.dto.ts | 11 +++++++++++ src/server/user/dto/registration.dto.ts | 16 ++++++++++++++++ 5 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 src/server/user/dto/login.dto.ts create mode 100644 src/server/user/dto/registration.dto.ts diff --git a/package.json b/package.json index e03d8e7..1f37e70 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "bcrypt": "^5.1.0", "chalk": "^5.0.0", "cheerio": "^1.0.0-rc.10", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.0", "dotenv": "^10.0.0", "express": "^4.17.2", "express-validator": "^6.14.0", diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 299fd3b..f978721 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,5 +1,7 @@ +import { LoginUserDto } from './../user/dto/login.dto'; +import { RegisterUserDto } from './../user/dto/registration.dto'; import { PrismaService } from './../prisma.service'; -import { Body, Controller, Post } from '@nestjs/common'; +import { Body, Controller, Post, UsePipes, ValidationPipe } from '@nestjs/common'; import { AuthService } from './auth.service'; import { UserRepository } from '../../database/repositories/user'; @@ -10,15 +12,16 @@ const prismaUser = new UserRepository(prisma) export class AuthController { constructor(private authService: AuthService) {} + @UsePipes(ValidationPipe) @Post('/registration') - async addUser(@Body() regData) { - return await this.authService.register(regData); + async addUser(@Body() dto : RegisterUserDto) { + return await this.authService.register(dto); } @Post('/login') - async login(@Body() userData) { - const user = await prismaUser.find(userData.username) - const validateUser = await this.authService.validateUser(userData.username, userData.password,user) + async login(@Body() dto : LoginUserDto) { + const user = await prismaUser.find(dto.username) + const validateUser = await this.authService.validateUser(user.username, dto.password,user) if(validateUser === true) { return this.authService.login(user) } diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 0096abe..5229ced 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,3 +1,4 @@ +import { RegisterUserDto } from './../user/dto/registration.dto'; import { PrismaService } from './../prisma.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; @@ -29,12 +30,10 @@ export class AuthService { }; } - async register(regData) { - const passwordhash = await bcrypt.hash(regData.password,12) - const userRegData = {"email": regData.email, - "username" : regData.username, - "passwordhash":passwordhash} - const user = await prismaUser.add(userRegData) + async register(dto : RegisterUserDto) { + const passwordhash = await bcrypt.hash(dto.password,12) + dto.passwordhash = passwordhash + const user = await prismaUser.add(dto) return user } } diff --git a/src/server/user/dto/login.dto.ts b/src/server/user/dto/login.dto.ts new file mode 100644 index 0000000..8ba7891 --- /dev/null +++ b/src/server/user/dto/login.dto.ts @@ -0,0 +1,11 @@ +import {IsNotEmpty, Length } from "class-validator"; + +export class LoginUserDto { + @IsNotEmpty({message: 'Username should not be empty'}) + @Length(6,15) + username : string; + @IsNotEmpty({message: 'Username should not be empty'}) + @Length(6,15) + password : string; +} + \ No newline at end of file diff --git a/src/server/user/dto/registration.dto.ts b/src/server/user/dto/registration.dto.ts new file mode 100644 index 0000000..7b5b41d --- /dev/null +++ b/src/server/user/dto/registration.dto.ts @@ -0,0 +1,16 @@ +import { IsEmail, IsNotEmpty, Length } from "class-validator"; + +export class RegisterUserDto { + @IsEmail() + email: string; + + @IsNotEmpty({message: 'Username should not be empty'}) + @Length(6,15) + username : string; + + @IsNotEmpty() + @Length(6,15) + password : string + passwordhash: any; + } + \ No newline at end of file From 6b2424bb2b6a8967792008e3a7c673a7a7fc8a5b Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:24:25 +0200 Subject: [PATCH 51/78] Type annotations for dto --- src/server/recipes/DTO/recipe.dto.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/recipes/DTO/recipe.dto.ts b/src/server/recipes/DTO/recipe.dto.ts index 5cf1293..8c79550 100644 --- a/src/server/recipes/DTO/recipe.dto.ts +++ b/src/server/recipes/DTO/recipe.dto.ts @@ -1,7 +1,7 @@ export class CreateRecipeDto { - readonly name; - readonly category_id; - readonly products; - readonly description; - readonly image_link; + readonly name: string; + readonly category_id: number; + readonly products: string; + readonly description: string; + readonly image_link?: string; } From 901586f7a0dc8b2a184f84adefb4c08879e5a980 Mon Sep 17 00:00:00 2001 From: water-korra Date: Thu, 12 Jan 2023 19:11:17 +0200 Subject: [PATCH 52/78] req.status added --- src/api/controllers/authController.js | 1 + src/server/auth/auth.controller.ts | 8 ++-- src/server/recipes/recipe.controller.ts | 33 ++++++++++++--- src/server/user/user.controller.ts | 56 +++++++++++++------------ 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/src/api/controllers/authController.js b/src/api/controllers/authController.js index 47758b4..7518e6d 100644 --- a/src/api/controllers/authController.js +++ b/src/api/controllers/authController.js @@ -4,6 +4,7 @@ const db = require('../../database/db'); const { validationResult } = require('express-validator'); const tokenService = require('../service/token-service'); const bcrypt = require('bcrypt'); +const { HttpCode } = require('@nestjs/common'); class AuthController { async registration(req, res) { diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index f978721..0efab19 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,7 +1,7 @@ import { LoginUserDto } from './../user/dto/login.dto'; import { RegisterUserDto } from './../user/dto/registration.dto'; import { PrismaService } from './../prisma.service'; -import { Body, Controller, Post, UsePipes, ValidationPipe } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post, Res, UsePipes, ValidationPipe } from '@nestjs/common'; import { AuthService } from './auth.service'; import { UserRepository } from '../../database/repositories/user'; @@ -19,14 +19,16 @@ export class AuthController { } @Post('/login') - async login(@Body() dto : LoginUserDto) { + async login(@Body() dto : LoginUserDto, @Res() res) { const user = await prismaUser.find(dto.username) const validateUser = await this.authService.validateUser(user.username, dto.password,user) if(validateUser === true) { return this.authService.login(user) } else{ - return 'incorrect username or password' + return res. + status(400) + .json({message: 'incorrect username or password'}) } } } diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 4dfda1f..892d81a 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,4 +1,4 @@ -import { Body, Controller, Delete, Get, Param, Post, Query } from "@nestjs/common"; +import { Body, Controller, Delete, Get, Param, Res, Post, Query } from "@nestjs/common"; import { CreateRecipeDto } from "./dto/recipe.dto"; import { RecipeService } from "./recipe.service"; const recipeCategories = require('./recipeCategories') @@ -10,7 +10,12 @@ import * as jsonRecipes from '../../parser/data/recipes.json' export class RecipeController { constructor(private recipeService : RecipeService) {} @Post() - addRecipe(@Body() dto: CreateRecipeDto) { + addRecipe(@Body() dto: CreateRecipeDto, @Res() res) { + if(!dto){ + return res. + status(400) + .json({message: 'no recipeId provided'}) + } return this.recipeService.addRecipe(dto); } @@ -20,19 +25,37 @@ export class RecipeController { } @Get() - getRecipeByName(@Body() recipe) { + getRecipeByName(@Body() recipe, @Res() res) { + if(!recipe){ + return res + .status(400) + .json({ message: `recipe was not provided`}); + + } return this.recipeService.getRecipeByName(recipe.name) } @Post('/categories') - addCategories(recipesObject) { + addCategories(recipesObject, @Res() res) { + if(!recipesObject){ + return res + .status(400) + .json({ message: `recipe categories object + was not provided`}); + } recipesObject = recipeCategories return this.recipeService.addRecipeCategoriesToDb(recipesObject) } @Post('/addRecipes') - addRecipes(recipes) { + addRecipes(recipes,@Res() res) { recipes = jsonRecipes + if(!recipes){ + return res + .status(400) + .json({ message: `recipes from json file + were not provided`}); + } return this.recipeService.addParsedRecipesToDb(recipes) } } diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index f96bccc..52b8f7c 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -1,4 +1,3 @@ -import { PrismaService } from './../prisma.service'; import { RecipeService } from './../recipes/recipe.service'; import { @@ -11,50 +10,55 @@ import { Delete, Query, UseGuards, - Request + Request, + Res, } from '@nestjs/common'; import { UserService } from './user.service'; import { AuthService } from 'auth/auth.service'; import { JwtAuthGuard } from 'auth/jwt-auth.guard'; -import { RecipeRepository } from '../../database/repositories/recipe'; -const prisma = new PrismaService(); -const recipe = new RecipeRepository(prisma); @Controller('/user') export class UserController { - constructor( private userService : UserService, private authService: AuthService, - private recipeService : RecipeService) {} + constructor( + private userService: UserService, + private recipeService: RecipeService + ) {} @UseGuards(JwtAuthGuard) @Post() - addFavRecipe(@Request() req) { - const userId = req.user.userId - const recipeId = req.body.recipeId - - const recipeData = {"userId" : userId, "recipeId" : recipeId} - return this.userService.addRecipe(recipeData) + addFavRecipe(@Request() req, @Res() res) { + const userId = req.user.userId; + const recipeId = req.body.recipeId; + if (!recipeId) { + return res.status(400).json({ message: 'no recipeId provided' }); + } + + const recipeData = { userId: userId, recipeId: recipeId }; + return this.userService.addRecipe(recipeData); } @UseGuards(JwtAuthGuard) @Get() async getFavRecipes(@Request() req) { - const userId = req.user.userId - const recipesId = await this.userService.getRecipes(userId) - let favRecipes = [] - for(let el of recipesId){ - favRecipes.push(await this.recipeService.getRecipeById(el)) + const userId = req.user.userId; + const recipesId = await this.userService.getRecipes(userId); + let favRecipes = []; + for (let el of recipesId) { + favRecipes.push(await this.recipeService.getRecipeById(el)); } - return favRecipes + return favRecipes; } @UseGuards(JwtAuthGuard) @Delete() - deleteFavRecipe(@Request() req) { - const userId = req.user.userId - const recipeId = req.body.recipeId - - const recipeData = {"userId" : userId, "recipeId" : recipeId} - return this.userService.deleteRecipe(recipeData) + deleteFavRecipe(@Request() req, res) { + const userId = req.user.userId; + const recipeId = req.body.recipeId; + if (!recipeId) { + return res.status(400).json({ message: 'no recipeId provided' }); + } + + const recipeData = { userId: userId, recipeId: recipeId }; + return this.userService.deleteRecipe(recipeData); } - } From 62fb171e5bfb58d93e946c85306c6ebf97f1ed92 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:49:54 +0200 Subject: [PATCH 53/78] ESLint + fix AuthController to use userService instead of direct prisma --- src/server/auth/auth.controller.ts | 51 +++++++----- src/server/auth/auth.service.ts | 25 +++--- src/server/recipes/recipe.controller.ts | 100 +++++++++++------------- src/server/recipes/recipe.service.ts | 42 +++++----- src/server/recipes/recipeCategories.ts | 36 ++++----- src/server/user/dto/login.dto.ts | 15 ++-- src/server/user/dto/registration.dto.ts | 25 +++--- src/server/user/user.controller.ts | 11 ++- src/server/user/user.service.ts | 18 +++-- 9 files changed, 162 insertions(+), 161 deletions(-) diff --git a/src/server/auth/auth.controller.ts b/src/server/auth/auth.controller.ts index 0efab19..2f28676 100644 --- a/src/server/auth/auth.controller.ts +++ b/src/server/auth/auth.controller.ts @@ -1,34 +1,43 @@ -import { LoginUserDto } from './../user/dto/login.dto'; -import { RegisterUserDto } from './../user/dto/registration.dto'; -import { PrismaService } from './../prisma.service'; -import { Body, Controller, HttpCode, Post, Res, UsePipes, ValidationPipe } from '@nestjs/common'; +import { LoginUserDto } from '../user/dto/login.dto'; +import { RegisterUserDto } from '../user/dto/registration.dto'; +import { + Body, + Controller, + Post, + Res, + UsePipes, + ValidationPipe, +} from '@nestjs/common'; import { AuthService } from './auth.service'; -import { UserRepository } from '../../database/repositories/user'; - -const prisma = new PrismaService() -const prismaUser = new UserRepository(prisma) +import { UserService } from '../user/user.service'; @Controller('auth') export class AuthController { - constructor(private authService: AuthService) {} + constructor( + private authService: AuthService, + private userService: UserService + ) {} @UsePipes(ValidationPipe) @Post('/registration') - async addUser(@Body() dto : RegisterUserDto) { + async addUser(@Body() dto: RegisterUserDto) { return await this.authService.register(dto); } @Post('/login') - async login(@Body() dto : LoginUserDto, @Res() res) { - const user = await prismaUser.find(dto.username) - const validateUser = await this.authService.validateUser(user.username, dto.password,user) - if(validateUser === true) { - return this.authService.login(user) - } - else{ - return res. - status(400) - .json({message: 'incorrect username or password'}) + async login(@Body() dto: LoginUserDto, @Res() res) { + const user = await this.userService.findUser(dto.username); + const validateUser = await this.authService.validateUser( + user.username, + dto.password, + user + ); + if (validateUser === true) { + return this.authService.login(user); + } else { + return res + .status(400) + .json({ message: 'incorrect username or password' }); } -} + } } diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 33caa09..43a0707 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,20 +1,25 @@ -import { RegisterUserDto } from './../user/dto/registration.dto'; -import { PrismaService } from './../prisma.service'; +import { RegisterUserDto } from '../user/dto/registration.dto'; +import { PrismaService } from '../prisma.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; import { UserRepository } from '../../database/repositories/user'; +import { UserEntity } from '../user/Entities/user.entity'; -const prisma = new PrismaService() -const prismaUser = new UserRepository(prisma) +const prisma = new PrismaService(); +const prismaUser = new UserRepository(prisma); @Injectable() export class AuthService { constructor(private jwtService: JwtService) {} - async validateUser(username: string, password: string, user: any ): Promise { + async validateUser( + username: string, + password: string, + user: UserEntity + ): Promise { const passwordCheck = await bcrypt.compare(password, user.password); - if (user.username = username && passwordCheck === true) { + if (user.username === username && passwordCheck === true) { return true; } return 'incorrect data'; @@ -29,10 +34,8 @@ export class AuthService { accessToken: this.jwtService.sign(payload), }; } - async register(dto : RegisterUserDto) { - const passwordhash = await bcrypt.hash(dto.password,12) - dto.passwordhash = passwordhash - const user = await prismaUser.add(dto) - return user + async register(dto: RegisterUserDto) { + dto.passwordhash = await bcrypt.hash(dto.password, 12); + return await prismaUser.add(dto); } } diff --git a/src/server/recipes/recipe.controller.ts b/src/server/recipes/recipe.controller.ts index 892d81a..8b68e82 100644 --- a/src/server/recipes/recipe.controller.ts +++ b/src/server/recipes/recipe.controller.ts @@ -1,61 +1,55 @@ -import { Body, Controller, Delete, Get, Param, Res, Post, Query } from "@nestjs/common"; -import { CreateRecipeDto } from "./dto/recipe.dto"; -import { RecipeService } from "./recipe.service"; -const recipeCategories = require('./recipeCategories') -import * as jsonRecipes from '../../parser/data/recipes.json' +import { Body, Controller, Get, Res, Post } from '@nestjs/common'; +import { CreateRecipeDto } from './dto/recipe.dto'; +import { RecipeService } from './recipe.service'; +import { recipeCategories } from './recipeCategories'; +import * as jsonRecipes from '../../parser/data/recipes.json'; - - -@Controller("/recipes") +@Controller('/recipes') export class RecipeController { - constructor(private recipeService : RecipeService) {} - @Post() - addRecipe(@Body() dto: CreateRecipeDto, @Res() res) { - if(!dto){ - return res. - status(400) - .json({message: 'no recipeId provided'}) - } - return this.recipeService.addRecipe(dto); - } + constructor(private recipeService: RecipeService) {} - @Get('/allrecipes') - getAllRecipes() { - return this.recipeService.getAllRecipes() + @Post() + addRecipe(@Body() dto: CreateRecipeDto, @Res() res) { + if (!dto) { + return res.status(400).json({ message: 'no recipeId provided' }); } - - @Get() - getRecipeByName(@Body() recipe, @Res() res) { - if(!recipe){ - return res - .status(400) - .json({ message: `recipe was not provided`}); - - } - return this.recipeService.getRecipeByName(recipe.name) + return this.recipeService.addRecipe(dto); + } + + @Get('/allrecipes') + getAllRecipes() { + return this.recipeService.getAllRecipes(); + } + + @Get() + getRecipeByName(@Body() recipe, @Res() res) { + if (!recipe) { + return res.status(400).json({ message: `recipe was not provided` }); } - - @Post('/categories') - addCategories(recipesObject, @Res() res) { - if(!recipesObject){ - return res - .status(400) - .json({ message: `recipe categories object - was not provided`}); - } - recipesObject = recipeCategories - return this.recipeService.addRecipeCategoriesToDb(recipesObject) + return this.recipeService.getRecipeByName(recipe.name); + } + + @Post('/categories') + addCategories(recipesObject, @Res() res) { + if (!recipesObject) { + return res.status(400).json({ + message: `recipe categories object + was not provided`, + }); } - - @Post('/addRecipes') - addRecipes(recipes,@Res() res) { - recipes = jsonRecipes - if(!recipes){ - return res - .status(400) - .json({ message: `recipes from json file - were not provided`}); - } - return this.recipeService.addParsedRecipesToDb(recipes) + recipesObject = recipeCategories; + return this.recipeService.addRecipeCategoriesToDb(recipesObject); + } + + @Post('/addRecipes') + addRecipes(recipes, @Res() res) { + recipes = jsonRecipes; + if (!recipes) { + return res.status(400).json({ + message: `recipes from json file + were not provided`, + }); } + return this.recipeService.addParsedRecipesToDb(recipes); + } } diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 2134dfc..11637ec 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,46 +1,42 @@ -import { CategoryRepository } from '../../database/repositories/category'; -import {Injectable} from '@nestjs/common'; +import CategoryRepository from '../../database/repositories/category'; +import RecipeRepository from '../../database/repositories/recipe'; +import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; +import { PrismaService } from '../prisma.service'; +import { recipeCategories } from './recipeCategories'; +import { RecipeEntity } from './Entities/recipe.entity'; -import { PrismaService } from '.././prisma.service'; -import { RecipeRepository } from '../../database/repositories/recipe'; - -const recipeCategories = require('./recipeCategories') const prisma = new PrismaService(); const recipe = new RecipeRepository(prisma); -const categories = new CategoryRepository(prisma) +const categories = new CategoryRepository(prisma); @Injectable() export class RecipeService { - async addRecipe (dto : CreateRecipeDto ) { - const newRecipe = await recipe.add(dto) - return newRecipe - + async addRecipe(dto: CreateRecipeDto) { + return await recipe.add(dto); } - async getRecipeById (id) { - const recipeById = await recipe.find(id) - return recipeById + async getRecipeById(id) { + return await recipe.find(id); } async getAllRecipes(): Promise { return await recipe.findAll(); } - async getRecipeByName(recipeName) { - const recipeByName = await recipe.search(recipeName) - return recipeByName + async getRecipeByName(recipeName): Promise { + return await recipe.search(recipeName); } async addRecipeCategoriesToDb(recipesArray) { - for(let i = 0 ; i < Object.keys(recipesArray).length; i++){ - await categories.add(Object.keys(recipesArray)[i]) + for (let i = 0; i < Object.keys(recipesArray).length; i++) { + await categories.add(Object.keys(recipesArray)[i]); } } - async addParsedRecipesToDb(jsonRecipes){ - for(const el of jsonRecipes){ - el.categoryId = recipeCategories.recipeCategories[el.categoryId] - await this.addRecipe(el) + async addParsedRecipesToDb(jsonRecipes) { + for (const el of jsonRecipes) { + el.categoryId = recipeCategories[el.categoryId]; + await this.addRecipe(el); } } } diff --git a/src/server/recipes/recipeCategories.ts b/src/server/recipes/recipeCategories.ts index e479244..97f54ea 100644 --- a/src/server/recipes/recipeCategories.ts +++ b/src/server/recipes/recipeCategories.ts @@ -1,20 +1,20 @@ const recipeCategories = { - "Бульоны и супы": 1, - "Горячие блюда": 2, - "Салаты": 3, - "Закуски": 4, - "Напитки": 5, - "Соусы": 6, - "Выпечка": 7, - "Десерты": 8, - "Заготовки": 9, - "Блюда из лаваша": 10, - "Готовим в аэрогриле": 11, - "Каши": 12, - "Украшения для блюд": 13, - "Готовим в пароварке": 14, - "Приготовление молочных продуктов": 15, - "Готовим в мультиварке": 16, - "Маринад, панировка": 17, + 'Бульоны и супы': 1, + 'Горячие блюда': 2, + 'Салаты': 3, + 'Закуски': 4, + 'Напитки': 5, + 'Соусы': 6, + 'Выпечка': 7, + 'Десерты': 8, + 'Заготовки': 9, + 'Блюда из лаваша': 10, + 'Готовим в аэрогриле': 11, + 'Каши': 12, + 'Украшения для блюд': 13, + 'Готовим в пароварке': 14, + 'Приготовление молочных продуктов': 15, + 'Готовим в мультиварке': 16, + 'Маринад, панировка': 17, }; -export {recipeCategories} \ No newline at end of file +export { recipeCategories }; diff --git a/src/server/user/dto/login.dto.ts b/src/server/user/dto/login.dto.ts index 8ba7891..2d517c4 100644 --- a/src/server/user/dto/login.dto.ts +++ b/src/server/user/dto/login.dto.ts @@ -1,11 +1,10 @@ -import {IsNotEmpty, Length } from "class-validator"; +import { IsNotEmpty, Length } from 'class-validator'; export class LoginUserDto { - @IsNotEmpty({message: 'Username should not be empty'}) - @Length(6,15) - username : string; - @IsNotEmpty({message: 'Username should not be empty'}) - @Length(6,15) - password : string; + @IsNotEmpty({ message: 'Username should not be empty' }) + @Length(6, 15) + username: string; + @IsNotEmpty({ message: 'Username should not be empty' }) + @Length(6, 15) + password: string; } - \ No newline at end of file diff --git a/src/server/user/dto/registration.dto.ts b/src/server/user/dto/registration.dto.ts index 7b5b41d..a75dea4 100644 --- a/src/server/user/dto/registration.dto.ts +++ b/src/server/user/dto/registration.dto.ts @@ -1,16 +1,15 @@ -import { IsEmail, IsNotEmpty, Length } from "class-validator"; +import { IsEmail, IsNotEmpty, Length } from 'class-validator'; export class RegisterUserDto { - @IsEmail() - email: string; + @IsEmail() + email: string; - @IsNotEmpty({message: 'Username should not be empty'}) - @Length(6,15) - username : string; - - @IsNotEmpty() - @Length(6,15) - password : string - passwordhash: any; - } - \ No newline at end of file + @IsNotEmpty({ message: 'Username should not be empty' }) + @Length(6, 15) + username: string; + + @IsNotEmpty() + @Length(6, 15) + password: string; + passwordHash: string; +} diff --git a/src/server/user/user.controller.ts b/src/server/user/user.controller.ts index 42baed6..e13876e 100644 --- a/src/server/user/user.controller.ts +++ b/src/server/user/user.controller.ts @@ -23,14 +23,14 @@ export class UserController { @UseGuards(JwtAuthGuard) @Post() - addFavRecipe(@Request() req, @Res() res) { + async addFavRecipe(@Request() req, @Res() res) { const userId = req.user.userId; const recipeId = req.body.recipeId; if (!recipeId) { return res.status(400).json({ message: 'no recipeId provided' }); } - - const recipeData = { userId: userId, recipeId: recipeId }; + const recipeData = { userId, recipeId }; + return await this.userService.addRecipe(recipeData); } @UseGuards(JwtAuthGuard) @@ -39,7 +39,7 @@ export class UserController { const userId = req.user.userId; const recipesId = await this.userService.getRecipes(userId); const favRecipes = []; - for (let el of recipesId) { + for (const el of recipesId) { favRecipes.push(await this.recipeService.getRecipeById(el)); } return favRecipes; @@ -53,8 +53,7 @@ export class UserController { if (!recipeId) { return res.status(400).json({ message: 'no recipeId provided' }); } - - const recipeData = { userId: userId, recipeId: recipeId }; + const recipeData = { userId, recipeId }; return this.userService.deleteRecipe(recipeData); } } diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 7b44594..cd1e577 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,22 +1,24 @@ -import { Injectable } from "@nestjs/common"; -import { PrismaService } from '.././prisma.service'; -import { UserRepository } from '../../database/repositories/user'; -import { UserEntity } from './Entities/user.entity'; +import { Injectable } from '@nestjs/common'; +import { PrismaService } from '../prisma.service'; +import UserRepository from '../../database/repositories/user'; import { FavouriteRecipeEntity } from '../recipes/Entities/favouriteRecipe.entity'; +import { UserEntity } from './Entities/user.entity'; const prisma = new PrismaService(); const user = new UserRepository(prisma); @Injectable() export class UserService { - async addRecipe(recipeData) { - const userFavRecipe = await user.addRecipe(recipeData) - return userFavRecipe - } + async addRecipe(recipeData) { + return await user.addRecipe(recipeData); + } async getRecipes(recipeData): Promise { return await user.findRecipes(recipeData); } + async findUser(username: string): Promise { + return await user.find(username); + } async deleteRecipe(recipeData) { return await user.deleteRecipe(recipeData); From 3dfa5f3f01a3590ce08e31b5b20cd5cef9a6f1c3 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:50:32 +0200 Subject: [PATCH 54/78] Change max-len to 100 --- src/server/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/.eslintrc.js b/src/server/.eslintrc.js index 3e1adf7..64b46f7 100644 --- a/src/server/.eslintrc.js +++ b/src/server/.eslintrc.js @@ -75,7 +75,7 @@ module.exports = { "max-len": [ "error", { - "code": 80, + "code": 100, "ignoreUrls": true } ], From 9a4bc2c6e2a2557241caaf7ba38d63cfbbe48929 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:50:51 +0200 Subject: [PATCH 55/78] added type: module --- src/database/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/database/package.json b/src/database/package.json index 2534e6f..b6a9508 100644 --- a/src/database/package.json +++ b/src/database/package.json @@ -6,6 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, + "type": "module", "keywords": [], "author": "", "license": "ISC", From f1fa95e1424db64c6e142f1d5d0a6f72e263e93c Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:51:38 +0200 Subject: [PATCH 56/78] ESLint, using ES export --- src/database/repositories/category.js | 7 ++----- src/database/repositories/recipe.js | 13 ++++--------- src/database/repositories/user.js | 9 +++------ 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/database/repositories/category.js b/src/database/repositories/category.js index 8aaf8bb..5e24bb2 100644 --- a/src/database/repositories/category.js +++ b/src/database/repositories/category.js @@ -1,6 +1,6 @@ 'use strict'; -class CategoryRepository { +export default class CategoryRepository { constructor(prisma) { this.prisma = prisma; } @@ -20,9 +20,6 @@ class CategoryRepository { } async findAll() { - const allCategories = await this.prisma.categories.findMany(); - return allCategories; //returns an array of all categories + return await this.prisma.categories.findMany(); //returns an array of all categories } } - -exports.CategoryRepository = CategoryRepository; diff --git a/src/database/repositories/recipe.js b/src/database/repositories/recipe.js index 81aa797..f465112 100644 --- a/src/database/repositories/recipe.js +++ b/src/database/repositories/recipe.js @@ -1,6 +1,6 @@ 'use strict'; -class RecipeRepository { +export default class RecipeRepository { constructor(prisma) { this.prisma = prisma; } @@ -24,17 +24,15 @@ class RecipeRepository { } async find(recipeId) { - const recipe = await this.prisma.recipes.findUnique({ + return await this.prisma.recipes.findUnique({ where: { id: parseInt(recipeId), }, }); - return recipe; } async findAll() { - const allRecipes = await this.prisma.recipes.findMany(); - return allRecipes; + return await this.prisma.recipes.findMany(); } async delete(recipeId) { @@ -58,15 +56,12 @@ class RecipeRepository { } async search(str) { - const recipes = await this.prisma.recipes.findMany({ + return await this.prisma.recipes.findMany({ where: { name: { contains: str, }, }, }); - return recipes; } } - -exports.RecipeRepository = RecipeRepository; diff --git a/src/database/repositories/user.js b/src/database/repositories/user.js index 2f4b3f6..246c549 100644 --- a/src/database/repositories/user.js +++ b/src/database/repositories/user.js @@ -1,6 +1,6 @@ 'use strict'; -class UserRepository { +export default class UserRepository { constructor(prisma) { this.prisma = prisma; } @@ -22,12 +22,11 @@ class UserRepository { } async find(username) { - const user = await this.prisma.users.findUnique({ + return await this.prisma.users.findUnique({ where: { username, }, - }); - return user; //returns user object + }); //returns user object } async findRecipes(userId) { @@ -70,5 +69,3 @@ class UserRepository { } } } - -exports.UserRepository = UserRepository; From 0cddf90ea0b2cf3fd4c5a491377fc11147e3d84b Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:55:55 +0200 Subject: [PATCH 57/78] Fix typo, change return type to bool --- src/server/auth/auth.service.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 43a0707..1e7ed61 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -3,7 +3,7 @@ import { PrismaService } from '../prisma.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; -import { UserRepository } from '../../database/repositories/user'; +import UserRepository from '../../database/repositories/user'; import { UserEntity } from '../user/Entities/user.entity'; const prisma = new PrismaService(); @@ -17,12 +17,9 @@ export class AuthService { username: string, password: string, user: UserEntity - ): Promise { + ): Promise { const passwordCheck = await bcrypt.compare(password, user.password); - if (user.username === username && passwordCheck === true) { - return true; - } - return 'incorrect data'; + return user.username === username && passwordCheck === true; } async login(user: UserEntity) { @@ -35,7 +32,7 @@ export class AuthService { }; } async register(dto: RegisterUserDto) { - dto.passwordhash = await bcrypt.hash(dto.password, 12); + dto.passwordHash = await bcrypt.hash(dto.password, 12); return await prismaUser.add(dto); } } From f90f4a0cd2ed9117ad86b6698529cc8d24a573e9 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:56:33 +0200 Subject: [PATCH 58/78] Commit to fix error with git --- src/server/recipes/dto/recipe.dto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/recipes/dto/recipe.dto.ts b/src/server/recipes/dto/recipe.dto.ts index 8c79550..825650d 100644 --- a/src/server/recipes/dto/recipe.dto.ts +++ b/src/server/recipes/dto/recipe.dto.ts @@ -3,5 +3,5 @@ export class CreateRecipeDto { readonly category_id: number; readonly products: string; readonly description: string; - readonly image_link?: string; + readonly image_link: string; } From 2a9457b61bfd414e9d2b68b73e648fb87056b549 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:57:03 +0200 Subject: [PATCH 59/78] Fix once aain --- src/server/recipes/dto/recipe.dto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/recipes/dto/recipe.dto.ts b/src/server/recipes/dto/recipe.dto.ts index 825650d..8c79550 100644 --- a/src/server/recipes/dto/recipe.dto.ts +++ b/src/server/recipes/dto/recipe.dto.ts @@ -3,5 +3,5 @@ export class CreateRecipeDto { readonly category_id: number; readonly products: string; readonly description: string; - readonly image_link: string; + readonly image_link?: string; } From ff73b292b7755ba31bddee1a14c8f6fdea93e74f Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:57:18 +0200 Subject: [PATCH 60/78] Add type annotations --- src/server/recipes/recipe.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 11637ec..0f8d44a 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -16,7 +16,7 @@ export class RecipeService { return await recipe.add(dto); } - async getRecipeById(id) { + async getRecipeById(id): Promise { return await recipe.find(id); } From 4abaaf094dd4dc81ec1f08b18afc80bf44b87770 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:57:43 +0200 Subject: [PATCH 61/78] Delete old server --- src/api/authMiddleware.js | 20 ----- src/api/controllers/Controller.js | 102 -------------------------- src/api/controllers/authController.js | 61 --------------- src/api/index.js | 25 ------- src/api/routes/authRouter.js | 19 ----- src/api/routes/router.js | 16 ---- src/api/service/parser-service.js | 45 ------------ src/api/service/token-service.js | 22 ------ src/api/service/user-service.js | 18 ----- 9 files changed, 328 deletions(-) delete mode 100644 src/api/authMiddleware.js delete mode 100644 src/api/controllers/Controller.js delete mode 100644 src/api/controllers/authController.js delete mode 100644 src/api/index.js delete mode 100644 src/api/routes/authRouter.js delete mode 100644 src/api/routes/router.js delete mode 100644 src/api/service/parser-service.js delete mode 100644 src/api/service/token-service.js delete mode 100644 src/api/service/user-service.js diff --git a/src/api/authMiddleware.js b/src/api/authMiddleware.js deleted file mode 100644 index 205cb1f..0000000 --- a/src/api/authMiddleware.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; -const jwt = require('jsonwebtoken'); - -module.exports = function(req, res, next) { - if (req.method === 'OPTIONS') { - next(); - } - - try { - const token = req.headers.authorization; - if (!token) { - return res.status(403).json({ message: 'User is not authorized' }); - } - req.user = jwt.verify(token, process.env.JWT_ACCESS_SECRET); - next(); - } catch (e) { - console.log(e); - return res.status(403).json({ message: 'User is not authorized' }); - } -}; diff --git a/src/api/controllers/Controller.js b/src/api/controllers/Controller.js deleted file mode 100644 index 0ad0cba..0000000 --- a/src/api/controllers/Controller.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -const db = require('../../database/db'); -const tokenService = require('../service/token-service'); - -const parser = require('../service/parser-service'); -const jsonData = require('../../parser/data/recipes.json'); -// parser.addRecipesFromParcer(jsonData); - -class Controller { - async addRecipe(req, res) { - try { - const { name, categoryId, products, description, imageLink } = req.body; - - await db.addRecipeToDb( - name, - categoryId, - products, - description, - imageLink - ); - return res.json({ message: 'Recipe added succefully' }); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'Error occured while adding recipe' }); - } - } - - async getRecipeById(req, res) { - try { - const { recipeId } = req.query; - console.log(req.query); - const neededRecipe = await db.getRecipe(recipeId); - return res.json(neededRecipe); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'error by getting recipe by id' }); - } - } - - async getRecipeByName(req, res) { - try { - const { recipeName } = req.query; - const recipe = await db.findRecipes(recipeName); - if (!recipe) { - return res.json({ message: "sorry, we don't have such recipe" }); - } - return res.json(recipe); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'error by getting recipe by name' }); - } - } - - async addUserRecipe(req, res) { - try { - const { recipeId } = req.body; - const userId = tokenService.getUserId(req); - await db.addUserFavRecipeToDb(userId, recipeId); - return res.json({ message: 'Recipe added succefully' }); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'Error occured while adding recipe' }); - } - } - - async getUserRecipes(req, res) { - try { - const userId = tokenService.getUserId(req); - const userFavId = await db.getUserFavRecipes(userId); - const userFavList = []; - if (!userFavId) { - return res.json({ mesage: 'You dont have any favorite recipes yet' }); - } - for (const el of userFavId) { - const recipeById = await db.getRecipe(el); - userFavList.push(recipeById); - } - - return res.json(userFavList); - } catch (e) { - console.log(e); - res - .status(400) - .json({ message: 'Error occured while gettig user recipes' }); - } - } - - async deleteUserRecipe(req, res) { - try { - const userId = tokenService.getUserId(req); - const { recipeId } = req.body; - await db.deleteFavouriteRecipe(userId, recipeId); - return res.status(200).json({ message: 'User recipe deleted' }); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'Error occured while deleting recipe' }); - } - } -} - -module.exports = new Controller(); diff --git a/src/api/controllers/authController.js b/src/api/controllers/authController.js deleted file mode 100644 index 7518e6d..0000000 --- a/src/api/controllers/authController.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const db = require('../../database/db'); -const { validationResult } = require('express-validator'); -const tokenService = require('../service/token-service'); -const bcrypt = require('bcrypt'); -const { HttpCode } = require('@nestjs/common'); - -class AuthController { - async registration(req, res) { - try { - const errors = validationResult(req); - if (!errors.isEmpty()) { - return res - .status(400) - .json({ message: 'Registration mistake', errors }); - } - const { username, password } = req.body; - - const hash = bcrypt.hashSync(password, 6); - await db.addUserToDb(username, username, hash); - - return res.json({ message: 'user added succcesfully' }); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'Registration error' }); - } - } - - async login(req, res) { - try { - const errors = validationResult(req); - if (!errors.isEmpty()) { - return res - .status(400) - .json({ message: 'Registration mistake', errors }); - } - - const { username, password } = req.body; - const user = await db.getUserData(username); - - if (!user) { - return res - .status(400) - .json({ message: `user ${username} was not found` }); - } - - const result = bcrypt.compareSync(password, user.password); - if (!result) { - return res.status(400).json({ message: `pass is not correct` }); - } - const token = tokenService.generateAccessToken(user.id); - return res.json({ token, user }); - } catch (e) { - console.log(e); - res.status(400).json({ message: 'Login error' }); - } - } -} - -module.exports = new AuthController(); diff --git a/src/api/index.js b/src/api/index.js deleted file mode 100644 index bfda62d..0000000 --- a/src/api/index.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -const express = require('express'); -const router = require('./routes/router'); -const authRouter = require('./routes/authRouter'); -const path = require('path'); - -require('dotenv').config(); - -const app = express(); -const PORT = process.env.PORT || 3000; - -app.use(express.json()); -app.use('/', express.static(path.join(__dirname, '/../client/dist'))); -app.use('/api', router); -app.use('/auth', authRouter); - -async function startApp() { - try { - app.listen(PORT, () => console.log(`Server started on PORT ${PORT}`)); - } catch (e) { - console.log(e); - } -} - -startApp(); diff --git a/src/api/routes/authRouter.js b/src/api/routes/authRouter.js deleted file mode 100644 index dd88086..0000000 --- a/src/api/routes/authRouter.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const AuthRouter = require('express'); -const authrouter = new AuthRouter(); -const authcontroller = require('../controllers/authController'); -const userService = require('../../api/service/user-service'); - -authrouter.post( - '/registration', - userService.validate(), - authcontroller.registration -); - -authrouter.post( - '/login', - userService.validate(), - authcontroller.login); - -module.exports = authrouter; diff --git a/src/api/routes/router.js b/src/api/routes/router.js deleted file mode 100644 index 59fd334..0000000 --- a/src/api/routes/router.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const Router = require('express'); -const router = new Router(); -const controller = require('../controllers/Controller'); -const authMiddleware = require('../authMiddleware'); - -router.post('/recipes', controller.addRecipe); -router.get('/recipes', controller.getRecipeByName); - -router.post('/user/recipes', authMiddleware, controller.addUserRecipe); -router.get('/user/recipes', authMiddleware, controller.getRecipeById); -router.delete('/user/recipes', authMiddleware, controller.deleteUserRecipe); -router.get('/user/myrecipes', authMiddleware, controller.getUserRecipes); - -module.exports = router; diff --git a/src/api/service/parser-service.js b/src/api/service/parser-service.js deleted file mode 100644 index 0f31dc5..0000000 --- a/src/api/service/parser-service.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const db = require('../../database/db'); - -const idRecipe = { - 'Бульоны и супы': 1, - 'Горячие блюда': 2, - 'Салаты': 3, - 'Закуски': 4, - 'Напитки': 5, - 'Соусы': 6, - 'Выпечка': 7, - 'Десерты': 8, - 'Заготовки': 9, - 'Блюда из лаваша': 10, - 'Готовим в аэрогриле': 11, - 'Каши': 12, - 'Украшения для блюд': 13, - 'Готовим в пароварке': 14, - 'Приготовление молочных продуктов': 15, - 'Готовим в мультиварке': 16, - 'Маринад, панировка': 17, -}; - -class ParseService { - /* - Remake it, - need to add categories to database first, or it'll throw error; - - */ - addRecipesFromParcer(jsonData) { - for (const el of jsonData) { - const name = el.name; - const categoryIdStr = el.categoryId; - const categoryId = idRecipe[categoryIdStr]; - const products = el.products; - const description = el.description; - const imageLink = el.imageLink; - db.addRecipeToDb(name, categoryId, products, description, imageLink); - } - } -} - -module.exports = new ParseService(); - diff --git a/src/api/service/token-service.js b/src/api/service/token-service.js deleted file mode 100644 index c3fba99..0000000 --- a/src/api/service/token-service.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const jwt = require('jsonwebtoken'); - -class TokenService { - generateAccessToken(id) { - const payload = { - id, - }; - return jwt.sign(payload, process.env.JWT_ACCESS_SECRET, { - expiresIn: '24h', - }); - } - - getUserId(req) { - const token = req.headers.authorization; - const payload = jwt.verify(token, process.env.JWT_ACCESS_SECRET); - return payload.id; - } -} - -module.exports = new TokenService(); diff --git a/src/api/service/user-service.js b/src/api/service/user-service.js deleted file mode 100644 index e2ffbd3..0000000 --- a/src/api/service/user-service.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const { check } = require('express-validator'); - -class UserService { - validate() { - const validation = [ - check('username', 'Username should not be empty').notEmpty(), - check('password', 'Password should be longer than 6 symbols').isLength({ - min: 4, - max: 14, - }), - ]; - return validation; - } -} - -module.exports = new UserService(); From d4ad3a3678475b1635659ce2939bd71fd41c9f33 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:18:32 +0200 Subject: [PATCH 62/78] Move prisma to server folder --- .gitignore | 2 +- package.json | 2 +- src/database/package.json | 16 ---------------- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 src/database/package.json diff --git a/.gitignore b/.gitignore index 9570eab..87a5def 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ src/api/.env src/api/node_modules src/api/package.json .env -src/database/prisma/migrations +src/server/prisma/migrations src/server/dist src/.env /.idea diff --git a/package.json b/package.json index 2c75b76..028de91 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "vue": "^2.6.14" }, "scripts": { - "preinstall": "sudo npm i -g @nestjs/cli && npx prisma generate --schema=./src/database/prisma/schema.prisma", + "preinstall": "sudo npm i -g @nestjs/cli && npx prisma generate --schema=./src/server/prisma/schema.prisma", "installDependecies": "npm --prefix src/client install && npm --prefix src/api install", "start": "npm run --prefix src/client build && npm run --prefix src/api start", "start:dev": "nest start --watch" diff --git a/src/database/package.json b/src/database/package.json deleted file mode 100644 index b6a9508..0000000 --- a/src/database/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "my-prisma-project", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "type": "module", - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "@prisma/client": "^4.8.1" - } -} From 70a85d067e628d503f9381f6194cbc10197256bb Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:19:10 +0200 Subject: [PATCH 63/78] Fixed entities by adding nullables --- src/server/recipes/Entities/recipe.entity.ts | 4 ++-- src/server/user/Entities/user.entity.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/recipes/Entities/recipe.entity.ts b/src/server/recipes/Entities/recipe.entity.ts index 0d9f943..1e7cef3 100644 --- a/src/server/recipes/Entities/recipe.entity.ts +++ b/src/server/recipes/Entities/recipe.entity.ts @@ -8,6 +8,6 @@ export interface RecipeEntity { products: string; description: string; image_link?: string; - favourite_recipes: FavouriteRecipeEntity[]; - categories: CategoryEntity[]; + favourite_recipes?: FavouriteRecipeEntity[]; + categories?: CategoryEntity[]; } diff --git a/src/server/user/Entities/user.entity.ts b/src/server/user/Entities/user.entity.ts index 2baf191..c11dcd5 100644 --- a/src/server/user/Entities/user.entity.ts +++ b/src/server/user/Entities/user.entity.ts @@ -5,5 +5,5 @@ export interface UserEntity { username: string; email: string; password: string; - favourite_recipes: FavouriteRecipeEntity[]; + favourite_recipes?: FavouriteRecipeEntity[]; } From 4019465781881a8db8f1455453d8e76cf3f912f2 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:19:38 +0200 Subject: [PATCH 64/78] Moved prisma to server folder --- src/{database => server}/prisma/schema.prisma | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{database => server}/prisma/schema.prisma (100%) diff --git a/src/database/prisma/schema.prisma b/src/server/prisma/schema.prisma similarity index 100% rename from src/database/prisma/schema.prisma rename to src/server/prisma/schema.prisma From a475e5ac24a9dddabd3b47790527418992c74b09 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:19:52 +0200 Subject: [PATCH 65/78] Fixed names --- src/server/recipes/dto/recipe.dto.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/recipes/dto/recipe.dto.ts b/src/server/recipes/dto/recipe.dto.ts index 8c79550..ffae211 100644 --- a/src/server/recipes/dto/recipe.dto.ts +++ b/src/server/recipes/dto/recipe.dto.ts @@ -1,7 +1,7 @@ export class CreateRecipeDto { readonly name: string; - readonly category_id: number; + readonly categoryId: number; readonly products: string; readonly description: string; - readonly image_link?: string; + readonly imageLink?: string; } From 3a5cf6d0fadc56386ecd5a2af7b04961ff677314 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:20:25 +0200 Subject: [PATCH 66/78] Refactored repos to nest style --- src/server/repos/category.repository.ts | 26 +++++++++ src/server/repos/recipe.repository.ts | 71 +++++++++++++++++++++++++ src/server/repos/user.repository.ts | 70 ++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 src/server/repos/category.repository.ts create mode 100644 src/server/repos/recipe.repository.ts create mode 100644 src/server/repos/user.repository.ts diff --git a/src/server/repos/category.repository.ts b/src/server/repos/category.repository.ts new file mode 100644 index 0000000..137776d --- /dev/null +++ b/src/server/repos/category.repository.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { PrismaService } from '../prisma.service'; +import { CategoryEntity } from '../recipes/Entities/category.entity'; + +@Injectable() +export class CategoryRepository { + constructor(private prisma: PrismaService) {} + + async add(name: string): Promise { + try { + await this.prisma.categories.create({ + data: { + name, + }, + }); + return true; + } catch (error) { + console.error(error); + return false; + } + } + + async findAll(): Promise { + return this.prisma.categories.findMany(); //returns an array of all categories + } +} diff --git a/src/server/repos/recipe.repository.ts b/src/server/repos/recipe.repository.ts new file mode 100644 index 0000000..28f65c7 --- /dev/null +++ b/src/server/repos/recipe.repository.ts @@ -0,0 +1,71 @@ +import { PrismaService } from '../prisma.service'; +import { Injectable } from '@nestjs/common'; +import { CreateRecipeDto } from '../recipes/DTO/recipe.dto'; +import { RecipeEntity } from '../recipes/Entities/recipe.entity'; + +@Injectable() +export class RecipeRepository { + constructor(private prisma: PrismaService) { + this.prisma = prisma; + } + + async add(recipeData: CreateRecipeDto) { + try { + await this.prisma.recipes.create({ + data: { + name: recipeData.name, + category_id: +recipeData.categoryId, + products: recipeData.products, + description: recipeData.description, + image_link: recipeData.imageLink, + }, + }); + return true; + } catch (error) { + console.error(error); + return false; + } + } + + async find(recipeId: string): Promise { + return this.prisma.recipes.findUnique({ + where: { + id: parseInt(recipeId), + }, + }); + } + + async findAll(): Promise { + return this.prisma.recipes.findMany(); + } + + async delete(recipeId: string): Promise { + try { + const deleteFavRecipes = this.prisma.favourite_recipes.deleteMany({ + where: { + recipe_id: parseInt(recipeId), + }, + }); + const deleteRecipe = this.prisma.recipes.delete({ + where: { + id: parseInt(recipeId), + }, + }); + await this.prisma.$transaction([deleteFavRecipes, deleteRecipe]); + return true; + } catch (error) { + console.error(error); + return false; + } + } + + async search(str: string): Promise { + return this.prisma.recipes.findMany({ + where: { + name: { + contains: str, + }, + }, + }); + } +} diff --git a/src/server/repos/user.repository.ts b/src/server/repos/user.repository.ts new file mode 100644 index 0000000..6c64ec4 --- /dev/null +++ b/src/server/repos/user.repository.ts @@ -0,0 +1,70 @@ +import { PrismaService } from '../prisma.service'; +import { RegisterUserDto } from '../user/dto/registration.dto'; +import { Injectable } from '@nestjs/common'; +import { UserEntity } from '../user/Entities/user.entity'; + +@Injectable() +export class UserRepository { + constructor(private prisma: PrismaService) {} + + async add(userData: RegisterUserDto): Promise { + try { + await this.prisma.users.create({ + data: { + email: userData.email, + username: userData.username, + password: userData.passwordHash, + }, + }); + return true; + } catch (error) { + console.error(error); + return false; + } + } + + async find(username: string): Promise { + return this.prisma.users.findUnique({ + where: { + username, + }, + }); //returns user object + } + + async findRecipes(userId: string) { + const favRecipes = await this.prisma.favourite_recipes.findMany({ + where: { + user_id: parseInt(userId), + }, + select: { + recipe_id: true, + }, + }); + return favRecipes.map(el => el.recipe_id); //returns an array user favourite recipes ids + } + + async addRecipe(recipeData): Promise { + const favRecipe = await this.prisma.favourite_recipes.create({ + data: { + user_id: recipeData.userId, + recipe_id: recipeData.recipeId, + }, + }); + return !!(typeof favRecipe !== 'undefined' && favRecipe); + } + + async deleteRecipe(recipeData): Promise { + try { + await this.prisma.favourite_recipes.deleteMany({ + where: { + user_id: recipeData.userId, + recipe_id: recipeData.recipeId, + }, + }); + return true; + } catch (error) { + console.error(error); + return false; + } + } +} From 06bdb7c5bd32ec8177f4865aa2ffcd25b1c817f4 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:28:10 +0200 Subject: [PATCH 67/78] Rewrote services to use dependency injection --- src/server/auth/auth.service.ts | 10 +++------- src/server/recipes/recipe.service.ts | 20 ++++++++++---------- src/server/user/user.service.ts | 16 +++++++--------- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 1e7ed61..116a961 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -1,17 +1,13 @@ import { RegisterUserDto } from '../user/dto/registration.dto'; -import { PrismaService } from '../prisma.service'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; -import UserRepository from '../../database/repositories/user'; import { UserEntity } from '../user/Entities/user.entity'; - -const prisma = new PrismaService(); -const prismaUser = new UserRepository(prisma); +import { UserRepository } from '../repos/user.repository'; @Injectable() export class AuthService { - constructor(private jwtService: JwtService) {} + constructor(private jwtService: JwtService, private user: UserRepository) {} async validateUser( username: string, @@ -33,6 +29,6 @@ export class AuthService { } async register(dto: RegisterUserDto) { dto.passwordHash = await bcrypt.hash(dto.password, 12); - return await prismaUser.add(dto); + return await this.user.add(dto); } } diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index 0f8d44a..d3e2aa0 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -2,34 +2,34 @@ import CategoryRepository from '../../database/repositories/category'; import RecipeRepository from '../../database/repositories/recipe'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; -import { PrismaService } from '../prisma.service'; import { recipeCategories } from './recipeCategories'; import { RecipeEntity } from './Entities/recipe.entity'; -const prisma = new PrismaService(); -const recipe = new RecipeRepository(prisma); -const categories = new CategoryRepository(prisma); - @Injectable() export class RecipeService { + constructor( + private recipe: RecipeRepository, + private categories: CategoryRepository + ) {} + async addRecipe(dto: CreateRecipeDto) { - return await recipe.add(dto); + return await this.recipe.add(dto); } async getRecipeById(id): Promise { - return await recipe.find(id); + return await this.recipe.find(id); } async getAllRecipes(): Promise { - return await recipe.findAll(); + return await this.recipe.findAll(); } async getRecipeByName(recipeName): Promise { - return await recipe.search(recipeName); + return await this.recipe.search(recipeName); } async addRecipeCategoriesToDb(recipesArray) { for (let i = 0; i < Object.keys(recipesArray).length; i++) { - await categories.add(Object.keys(recipesArray)[i]); + await this.categories.add(Object.keys(recipesArray)[i]); } } diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index cd1e577..b8d5db7 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,26 +1,24 @@ import { Injectable } from '@nestjs/common'; -import { PrismaService } from '../prisma.service'; -import UserRepository from '../../database/repositories/user'; import { FavouriteRecipeEntity } from '../recipes/Entities/favouriteRecipe.entity'; import { UserEntity } from './Entities/user.entity'; - -const prisma = new PrismaService(); -const user = new UserRepository(prisma); +import { UserRepository } from '../repos/user.repository'; @Injectable() export class UserService { + constructor(private user: UserRepository) {} + async addRecipe(recipeData) { - return await user.addRecipe(recipeData); + return await this.user.addRecipe(recipeData); } async getRecipes(recipeData): Promise { - return await user.findRecipes(recipeData); + return await this.user.findRecipes(recipeData); } async findUser(username: string): Promise { - return await user.find(username); + return await this.user.find(username); } async deleteRecipe(recipeData) { - return await user.deleteRecipe(recipeData); + return await this.user.deleteRecipe(recipeData); } } From 9dee71a7a974336fd0095efe7d60387a2ecb9ab8 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:28:45 +0200 Subject: [PATCH 68/78] Fixed findRecipes to return recipes not ids --- src/server/repos/user.repository.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/server/repos/user.repository.ts b/src/server/repos/user.repository.ts index 6c64ec4..465e395 100644 --- a/src/server/repos/user.repository.ts +++ b/src/server/repos/user.repository.ts @@ -32,15 +32,11 @@ export class UserRepository { } async findRecipes(userId: string) { - const favRecipes = await this.prisma.favourite_recipes.findMany({ + return this.prisma.favourite_recipes.findMany({ where: { user_id: parseInt(userId), }, - select: { - recipe_id: true, - }, - }); - return favRecipes.map(el => el.recipe_id); //returns an array user favourite recipes ids + }); //returns an array user favourite recipes ids } async addRecipe(recipeData): Promise { From e1d667f5e173f1f7c180f7cf839e161776003067 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:31:06 +0200 Subject: [PATCH 69/78] Move Entities to repos folder --- package.json | 1 + src/server/auth/auth.service.ts | 2 +- src/server/{recipes => prisma}/Entities/category.entity.ts | 0 .../{recipes => prisma}/Entities/favouriteRecipe.entity.ts | 2 +- src/server/{recipes => prisma}/Entities/recipe.entity.ts | 0 src/server/{user => prisma}/Entities/user.entity.ts | 2 +- src/server/recipes/recipe.service.ts | 2 +- src/server/repos/category.repository.ts | 2 +- src/server/repos/recipe.repository.ts | 2 +- src/server/repos/user.repository.ts | 2 +- src/server/user/user.service.ts | 4 ++-- 11 files changed, 10 insertions(+), 9 deletions(-) rename src/server/{recipes => prisma}/Entities/category.entity.ts (100%) rename src/server/{recipes => prisma}/Entities/favouriteRecipe.entity.ts (76%) rename src/server/{recipes => prisma}/Entities/recipe.entity.ts (100%) rename src/server/{user => prisma}/Entities/user.entity.ts (63%) diff --git a/package.json b/package.json index 028de91..98ce8df 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@nestjs/jwt": "^10.0.1", "@nestjs/passport": "^9.0.0", "@nestjs/platform-express": "^9.2.1", + "@nestjs/platform-fastify": "^9.2.1", "@nestjs/schematics": "^9.0.4", "@prisma/client": "^4.8.1", "bcrypt": "^5.1.0", diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 116a961..57bdbbd 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -2,7 +2,7 @@ import { RegisterUserDto } from '../user/dto/registration.dto'; import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; -import { UserEntity } from '../user/Entities/user.entity'; +import { UserEntity } from '../prisma/Entities/user.entity'; import { UserRepository } from '../repos/user.repository'; @Injectable() diff --git a/src/server/recipes/Entities/category.entity.ts b/src/server/prisma/Entities/category.entity.ts similarity index 100% rename from src/server/recipes/Entities/category.entity.ts rename to src/server/prisma/Entities/category.entity.ts diff --git a/src/server/recipes/Entities/favouriteRecipe.entity.ts b/src/server/prisma/Entities/favouriteRecipe.entity.ts similarity index 76% rename from src/server/recipes/Entities/favouriteRecipe.entity.ts rename to src/server/prisma/Entities/favouriteRecipe.entity.ts index 7ba80cd..0fbee99 100644 --- a/src/server/recipes/Entities/favouriteRecipe.entity.ts +++ b/src/server/prisma/Entities/favouriteRecipe.entity.ts @@ -1,5 +1,5 @@ import { RecipeEntity } from './recipe.entity'; -import { UserEntity } from '../../user/Entities/user.entity'; +import { UserEntity } from './user.entity'; export interface FavouriteRecipeEntity { id: number; diff --git a/src/server/recipes/Entities/recipe.entity.ts b/src/server/prisma/Entities/recipe.entity.ts similarity index 100% rename from src/server/recipes/Entities/recipe.entity.ts rename to src/server/prisma/Entities/recipe.entity.ts diff --git a/src/server/user/Entities/user.entity.ts b/src/server/prisma/Entities/user.entity.ts similarity index 63% rename from src/server/user/Entities/user.entity.ts rename to src/server/prisma/Entities/user.entity.ts index c11dcd5..36ef6d4 100644 --- a/src/server/user/Entities/user.entity.ts +++ b/src/server/prisma/Entities/user.entity.ts @@ -1,4 +1,4 @@ -import { FavouriteRecipeEntity } from '../../recipes/Entities/favouriteRecipe.entity'; +import { FavouriteRecipeEntity } from './favouriteRecipe.entity'; export interface UserEntity { id: number; diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index d3e2aa0..c876df6 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -3,7 +3,7 @@ import RecipeRepository from '../../database/repositories/recipe'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; import { recipeCategories } from './recipeCategories'; -import { RecipeEntity } from './Entities/recipe.entity'; +import { RecipeEntity } from '../prisma/Entities/recipe.entity'; @Injectable() export class RecipeService { diff --git a/src/server/repos/category.repository.ts b/src/server/repos/category.repository.ts index 137776d..fa5d9b2 100644 --- a/src/server/repos/category.repository.ts +++ b/src/server/repos/category.repository.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { PrismaService } from '../prisma.service'; -import { CategoryEntity } from '../recipes/Entities/category.entity'; +import { CategoryEntity } from '../prisma/Entities/category.entity'; @Injectable() export class CategoryRepository { diff --git a/src/server/repos/recipe.repository.ts b/src/server/repos/recipe.repository.ts index 28f65c7..33b1b77 100644 --- a/src/server/repos/recipe.repository.ts +++ b/src/server/repos/recipe.repository.ts @@ -1,7 +1,7 @@ import { PrismaService } from '../prisma.service'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from '../recipes/DTO/recipe.dto'; -import { RecipeEntity } from '../recipes/Entities/recipe.entity'; +import { RecipeEntity } from '../prisma/Entities/recipe.entity'; @Injectable() export class RecipeRepository { diff --git a/src/server/repos/user.repository.ts b/src/server/repos/user.repository.ts index 465e395..53147b8 100644 --- a/src/server/repos/user.repository.ts +++ b/src/server/repos/user.repository.ts @@ -1,7 +1,7 @@ import { PrismaService } from '../prisma.service'; import { RegisterUserDto } from '../user/dto/registration.dto'; import { Injectable } from '@nestjs/common'; -import { UserEntity } from '../user/Entities/user.entity'; +import { UserEntity } from '../prisma/Entities/user.entity'; @Injectable() export class UserRepository { diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index b8d5db7..24eac7b 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { FavouriteRecipeEntity } from '../recipes/Entities/favouriteRecipe.entity'; -import { UserEntity } from './Entities/user.entity'; +import { FavouriteRecipeEntity } from '../prisma/Entities/favouriteRecipe.entity'; +import { UserEntity } from '../prisma/Entities/user.entity'; import { UserRepository } from '../repos/user.repository'; @Injectable() From 2ea4f73f0968ba04a3eed271d0fc4725cd2cda5f Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:31:56 +0200 Subject: [PATCH 70/78] Added fastify support --- src/server/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/main.ts b/src/server/main.ts index 6b7607f..3ceafda 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -1,5 +1,9 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import { + FastifyAdapter, + NestFastifyApplication, +} from '@nestjs/platform-fastify'; import * as Process from 'process'; import * as dotenv from 'dotenv'; dotenv.config(); @@ -7,7 +11,10 @@ dotenv.config(); const start = async () => { try { const PORT = Process.env.PORT || 5001; - const app = await NestFactory.create(AppModule); + const app = await NestFactory.create( + AppModule, + new FastifyAdapter() + ); await app.listen(PORT, () => console.log(`server started on PORT ${PORT}`)); } catch (e) { console.log(e); From 707cf0079eaea11ed19aafe875651aaab1b9667b Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:32:51 +0200 Subject: [PATCH 71/78] Move prisma.service.ts to repos --- src/server/repos/category.repository.ts | 2 +- src/server/{ => repos}/prisma.service.ts | 0 src/server/repos/recipe.repository.ts | 2 +- src/server/repos/user.repository.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/server/{ => repos}/prisma.service.ts (100%) diff --git a/src/server/repos/category.repository.ts b/src/server/repos/category.repository.ts index fa5d9b2..e9d134a 100644 --- a/src/server/repos/category.repository.ts +++ b/src/server/repos/category.repository.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common'; -import { PrismaService } from '../prisma.service'; +import { PrismaService } from './prisma.service'; import { CategoryEntity } from '../prisma/Entities/category.entity'; @Injectable() diff --git a/src/server/prisma.service.ts b/src/server/repos/prisma.service.ts similarity index 100% rename from src/server/prisma.service.ts rename to src/server/repos/prisma.service.ts diff --git a/src/server/repos/recipe.repository.ts b/src/server/repos/recipe.repository.ts index 33b1b77..92410e5 100644 --- a/src/server/repos/recipe.repository.ts +++ b/src/server/repos/recipe.repository.ts @@ -1,4 +1,4 @@ -import { PrismaService } from '../prisma.service'; +import { PrismaService } from './prisma.service'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from '../recipes/DTO/recipe.dto'; import { RecipeEntity } from '../prisma/Entities/recipe.entity'; diff --git a/src/server/repos/user.repository.ts b/src/server/repos/user.repository.ts index 53147b8..3d301c0 100644 --- a/src/server/repos/user.repository.ts +++ b/src/server/repos/user.repository.ts @@ -1,4 +1,4 @@ -import { PrismaService } from '../prisma.service'; +import { PrismaService } from './prisma.service'; import { RegisterUserDto } from '../user/dto/registration.dto'; import { Injectable } from '@nestjs/common'; import { UserEntity } from '../prisma/Entities/user.entity'; From 4fdafdb396558d63a27a55800abdff74d05678bc Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:33:23 +0200 Subject: [PATCH 72/78] Rename folder to repositories --- src/server/auth/auth.service.ts | 2 +- src/server/{repos => repositories}/category.repository.ts | 0 src/server/{repos => repositories}/prisma.service.ts | 0 src/server/{repos => repositories}/recipe.repository.ts | 0 src/server/{repos => repositories}/user.repository.ts | 0 src/server/user/user.service.ts | 2 +- 6 files changed, 2 insertions(+), 2 deletions(-) rename src/server/{repos => repositories}/category.repository.ts (100%) rename src/server/{repos => repositories}/prisma.service.ts (100%) rename src/server/{repos => repositories}/recipe.repository.ts (100%) rename src/server/{repos => repositories}/user.repository.ts (100%) diff --git a/src/server/auth/auth.service.ts b/src/server/auth/auth.service.ts index 57bdbbd..1f93df1 100644 --- a/src/server/auth/auth.service.ts +++ b/src/server/auth/auth.service.ts @@ -3,7 +3,7 @@ import { BadRequestException, Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; import { UserEntity } from '../prisma/Entities/user.entity'; -import { UserRepository } from '../repos/user.repository'; +import { UserRepository } from '../repositories/user.repository'; @Injectable() export class AuthService { diff --git a/src/server/repos/category.repository.ts b/src/server/repositories/category.repository.ts similarity index 100% rename from src/server/repos/category.repository.ts rename to src/server/repositories/category.repository.ts diff --git a/src/server/repos/prisma.service.ts b/src/server/repositories/prisma.service.ts similarity index 100% rename from src/server/repos/prisma.service.ts rename to src/server/repositories/prisma.service.ts diff --git a/src/server/repos/recipe.repository.ts b/src/server/repositories/recipe.repository.ts similarity index 100% rename from src/server/repos/recipe.repository.ts rename to src/server/repositories/recipe.repository.ts diff --git a/src/server/repos/user.repository.ts b/src/server/repositories/user.repository.ts similarity index 100% rename from src/server/repos/user.repository.ts rename to src/server/repositories/user.repository.ts diff --git a/src/server/user/user.service.ts b/src/server/user/user.service.ts index 24eac7b..d96b9ef 100644 --- a/src/server/user/user.service.ts +++ b/src/server/user/user.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { FavouriteRecipeEntity } from '../prisma/Entities/favouriteRecipe.entity'; import { UserEntity } from '../prisma/Entities/user.entity'; -import { UserRepository } from '../repos/user.repository'; +import { UserRepository } from '../repositories/user.repository'; @Injectable() export class UserService { From d9dcd3ed195f29cc6a2c6e637a2a5c7dbf0ecf08 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:34:24 +0200 Subject: [PATCH 73/78] Installed servestatic --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 98ce8df..e93c28e 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@nestjs/platform-express": "^9.2.1", "@nestjs/platform-fastify": "^9.2.1", "@nestjs/schematics": "^9.0.4", + "@nestjs/serve-static": "^3.0.0", "@prisma/client": "^4.8.1", "bcrypt": "^5.1.0", "chalk": "^5.0.0", From 84ac4f5d18260fde9479451e5c97526757b5cf64 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:35:49 +0200 Subject: [PATCH 74/78] Imported servestatic into module --- src/server/app.module.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/server/app.module.ts b/src/server/app.module.ts index 4a38e29..a764f98 100644 --- a/src/server/app.module.ts +++ b/src/server/app.module.ts @@ -2,7 +2,16 @@ import { Module } from '@nestjs/common'; import { RecipeModule } from './recipes/recipe.module'; import { UserModule } from 'user/user.module'; import { AuthModule } from 'auth/auth.module'; +import { ServeStaticModule } from '@nestjs/serve-static'; +import { join } from 'path'; @Module({ - imports: [RecipeModule, UserModule, AuthModule], + imports: [ + ServeStaticModule.forRoot({ + rootPath: join(__dirname, '..', './client/dist'), + }), + RecipeModule, + UserModule, + AuthModule, + ], }) export class AppModule {} From 16cd2d6d6f34737abd8d68e4df31d7e10cef07e5 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:54:09 +0200 Subject: [PATCH 75/78] Move prismaService to prisma folder --- src/server/{repositories => prisma}/prisma.service.ts | 0 src/server/recipes/recipe.module.ts | 4 +++- src/server/recipes/recipe.service.ts | 6 +++--- src/server/repositories/category.repository.ts | 2 +- src/server/repositories/recipe.repository.ts | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) rename src/server/{repositories => prisma}/prisma.service.ts (100%) diff --git a/src/server/repositories/prisma.service.ts b/src/server/prisma/prisma.service.ts similarity index 100% rename from src/server/repositories/prisma.service.ts rename to src/server/prisma/prisma.service.ts diff --git a/src/server/recipes/recipe.module.ts b/src/server/recipes/recipe.module.ts index 2af395f..2ea89cc 100644 --- a/src/server/recipes/recipe.module.ts +++ b/src/server/recipes/recipe.module.ts @@ -1,9 +1,11 @@ import { Module } from '@nestjs/common'; import { RecipeController } from './recipe.controller'; import { RecipeService } from './recipe.service'; +import { RecipeRepository } from '../repositories/recipe.repository'; +import { CategoryRepository } from '../repositories/category.repository'; @Module({ controllers: [RecipeController], - providers: [RecipeService], + providers: [RecipeService, RecipeRepository, CategoryRepository], }) export class RecipeModule {} diff --git a/src/server/recipes/recipe.service.ts b/src/server/recipes/recipe.service.ts index c876df6..bb747fd 100644 --- a/src/server/recipes/recipe.service.ts +++ b/src/server/recipes/recipe.service.ts @@ -1,9 +1,9 @@ -import CategoryRepository from '../../database/repositories/category'; -import RecipeRepository from '../../database/repositories/recipe'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from './dto/recipe.dto'; import { recipeCategories } from './recipeCategories'; import { RecipeEntity } from '../prisma/Entities/recipe.entity'; +import { RecipeRepository } from '../repositories/recipe.repository'; +import { CategoryRepository } from '../repositories/category.repository'; @Injectable() export class RecipeService { @@ -23,7 +23,7 @@ export class RecipeService { async getAllRecipes(): Promise { return await this.recipe.findAll(); } - async getRecipeByName(recipeName): Promise { + async getRecipeByName(recipeName): Promise { return await this.recipe.search(recipeName); } diff --git a/src/server/repositories/category.repository.ts b/src/server/repositories/category.repository.ts index e9d134a..7d4fc35 100644 --- a/src/server/repositories/category.repository.ts +++ b/src/server/repositories/category.repository.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common'; -import { PrismaService } from './prisma.service'; +import { PrismaService } from '../prisma/prisma.service'; import { CategoryEntity } from '../prisma/Entities/category.entity'; @Injectable() diff --git a/src/server/repositories/recipe.repository.ts b/src/server/repositories/recipe.repository.ts index 92410e5..fca41da 100644 --- a/src/server/repositories/recipe.repository.ts +++ b/src/server/repositories/recipe.repository.ts @@ -1,4 +1,4 @@ -import { PrismaService } from './prisma.service'; +import { PrismaService } from '../prisma/prisma.service'; import { Injectable } from '@nestjs/common'; import { CreateRecipeDto } from '../recipes/DTO/recipe.dto'; import { RecipeEntity } from '../prisma/Entities/recipe.entity'; From 26bc39fb053ca2c0058995ea8d22fc84d44f923b Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:54:58 +0200 Subject: [PATCH 76/78] Move prismaService to prisma folder --- src/server/repositories/user.repository.ts | 2 +- src/server/user/user.module.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/server/repositories/user.repository.ts b/src/server/repositories/user.repository.ts index 3d301c0..ffe665e 100644 --- a/src/server/repositories/user.repository.ts +++ b/src/server/repositories/user.repository.ts @@ -1,4 +1,4 @@ -import { PrismaService } from './prisma.service'; +import { PrismaService } from '../prisma/prisma.service'; import { RegisterUserDto } from '../user/dto/registration.dto'; import { Injectable } from '@nestjs/common'; import { UserEntity } from '../prisma/Entities/user.entity'; diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index 0223198..cba5b54 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -5,9 +5,17 @@ import { Module } from '@nestjs/common'; import { AuthService } from 'auth/auth.service'; import { UserController } from './user.controller'; import { UserService } from './user.service'; +import { UserRepository } from '../repositories/user.repository'; @Module({ - providers: [UserService, AuthService, JwtService, JwtStrategy, RecipeService], + providers: [ + UserService, + AuthService, + JwtService, + JwtStrategy, + RecipeService, + UserRepository, + ], exports: [UserService], controllers: [UserController], }) From 7ee8c93e2ac0fb2d83c790bf7568bcae681d4488 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Thu, 12 Jan 2023 23:19:53 +0200 Subject: [PATCH 77/78] Fixed DI problems --- package.json | 1 + src/server/auth/auth.module.ts | 10 +++++++++- src/server/recipes/recipe.module.ts | 8 +++++++- src/server/user/user.module.ts | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e93c28e..c210a6e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@fastify/static": "^6.6.1", "@nestjs/cli": "^9.1.8", "@nestjs/common": "^9.2.1", "@nestjs/core": "^9.2.1", diff --git a/src/server/auth/auth.module.ts b/src/server/auth/auth.module.ts index a46fbca..4ca9cc1 100644 --- a/src/server/auth/auth.module.ts +++ b/src/server/auth/auth.module.ts @@ -5,6 +5,8 @@ import { AuthService } from './auth.service'; import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { AuthController } from './auth.controller'; +import { UserRepository } from '../repositories/user.repository'; +import { PrismaService } from '../prisma/prisma.service'; @Module({ imports: [ @@ -14,7 +16,13 @@ import { AuthController } from './auth.controller'; signOptions: { expiresIn: '3660s' }, }), ], - providers: [AuthService, JwtStrategy, UserService], + providers: [ + AuthService, + JwtStrategy, + UserService, + UserRepository, + PrismaService, + ], controllers: [AuthController], exports: [AuthService], }) diff --git a/src/server/recipes/recipe.module.ts b/src/server/recipes/recipe.module.ts index 2ea89cc..988c22c 100644 --- a/src/server/recipes/recipe.module.ts +++ b/src/server/recipes/recipe.module.ts @@ -3,9 +3,15 @@ import { RecipeController } from './recipe.controller'; import { RecipeService } from './recipe.service'; import { RecipeRepository } from '../repositories/recipe.repository'; import { CategoryRepository } from '../repositories/category.repository'; +import { PrismaService } from '../prisma/prisma.service'; @Module({ controllers: [RecipeController], - providers: [RecipeService, RecipeRepository, CategoryRepository], + providers: [ + RecipeService, + RecipeRepository, + CategoryRepository, + PrismaService, + ], }) export class RecipeModule {} diff --git a/src/server/user/user.module.ts b/src/server/user/user.module.ts index cba5b54..6c58db8 100644 --- a/src/server/user/user.module.ts +++ b/src/server/user/user.module.ts @@ -6,6 +6,9 @@ import { AuthService } from 'auth/auth.service'; import { UserController } from './user.controller'; import { UserService } from './user.service'; import { UserRepository } from '../repositories/user.repository'; +import { RecipeRepository } from '../repositories/recipe.repository'; +import { CategoryRepository } from '../repositories/category.repository'; +import { PrismaService } from '../prisma/prisma.service'; @Module({ providers: [ @@ -15,6 +18,9 @@ import { UserRepository } from '../repositories/user.repository'; JwtStrategy, RecipeService, UserRepository, + RecipeRepository, + CategoryRepository, + PrismaService, ], exports: [UserService], controllers: [UserController], From de05dd314d0186dd3b7b9e891e9cd7b0c73cd838 Mon Sep 17 00:00:00 2001 From: akaeyuhi <54174780+akaeyuhi@users.noreply.github.com> Date: Fri, 13 Jan 2023 00:13:15 +0200 Subject: [PATCH 78/78] delete .idea and old db --- .idea/.gitignore | 5 -- .idea/codeStyles/Project.xml | 61 ----------------------- .idea/codeStyles/codeStyleConfig.xml | 5 -- .idea/cyberchef.iml | 12 ----- .idea/modules.xml | 8 --- .idea/vcs.xml | 6 --- src/database/repositories/category.js | 25 ---------- src/database/repositories/recipe.js | 67 ------------------------- src/database/repositories/user.js | 71 --------------------------- 9 files changed, 260 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/cyberchef.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 src/database/repositories/category.js delete mode 100644 src/database/repositories/recipe.js delete mode 100644 src/database/repositories/user.js diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index b58b603..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 7ba3bc0..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/cyberchef.iml b/.idea/cyberchef.iml deleted file mode 100644 index 0c8867d..0000000 --- a/.idea/cyberchef.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 34d5e16..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/database/repositories/category.js b/src/database/repositories/category.js deleted file mode 100644 index 5e24bb2..0000000 --- a/src/database/repositories/category.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -export default class CategoryRepository { - constructor(prisma) { - this.prisma = prisma; - } - - async add(name) { - try { - await this.prisma.categories.create({ - data: { - name, - }, - }); - return true; - } catch (error) { - console.error(error); - return false; - } - } - - async findAll() { - return await this.prisma.categories.findMany(); //returns an array of all categories - } -} diff --git a/src/database/repositories/recipe.js b/src/database/repositories/recipe.js deleted file mode 100644 index f465112..0000000 --- a/src/database/repositories/recipe.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -export default class RecipeRepository { - constructor(prisma) { - this.prisma = prisma; - } - - async add(recipeData) { - try { - await this.prisma.recipes.create({ - data: { - name: recipeData.name, - category_id: parseInt(recipeData.categoryId), - products: recipeData.products, - description: recipeData.description, - image_link: recipeData.imageLink, - }, - }); - return true; - } catch (error) { - console.error(error); - return false; - } - } - - async find(recipeId) { - return await this.prisma.recipes.findUnique({ - where: { - id: parseInt(recipeId), - }, - }); - } - - async findAll() { - return await this.prisma.recipes.findMany(); - } - - async delete(recipeId) { - try { - const deleteFavRecipes = this.prisma.favourite_recipes.deleteMany({ - where: { - recipe_id: parseInt(recipeId), - }, - }); - const deleteRecipe = this.prisma.recipes.delete({ - where: { - id: parseInt(recipeId), - }, - }); - await this.prisma.$transaction([deleteFavRecipes, deleteRecipe]); - return true; - } catch (error) { - console.error(error); - return false; - } - } - - async search(str) { - return await this.prisma.recipes.findMany({ - where: { - name: { - contains: str, - }, - }, - }); - } -} diff --git a/src/database/repositories/user.js b/src/database/repositories/user.js deleted file mode 100644 index 246c549..0000000 --- a/src/database/repositories/user.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -export default class UserRepository { - constructor(prisma) { - this.prisma = prisma; - } - - async add(userData) { - try { - await this.prisma.users.create({ - data: { - email: userData.email, - username: userData.username, - password: userData.passwordhash, - }, - }); - return true; - } catch (error) { - console.error(error); - return false; - } - } - - async find(username) { - return await this.prisma.users.findUnique({ - where: { - username, - }, - }); //returns user object - } - - async findRecipes(userId) { - let favRecipes = await this.prisma.favourite_recipes.findMany({ - where: { - user_id: parseInt(userId), - }, - select: { - recipe_id: true, - }, - }); - favRecipes = favRecipes.map(el => el.recipe_id); - return favRecipes; //returns an array user favourite recipes ids - } - - async addRecipe(recipeData) { - const favRecipe = await this.prisma.favourite_recipes.create({ - data: { - user_id: recipeData.userId, - recipe_id: recipeData.recipeId, - }, - }); - if (typeof favRecipe !== 'undefined' && favRecipe) { - return true; - } - } - - async deleteRecipe(recipeData) { - try { - await this.prisma.favourite_recipes.deleteMany({ - where: { - user_id: recipeData.userId, - recipe_id: recipeData.recipeId, - }, - }); - return true; - } catch (error) { - console.error(error); - return false; - } - } -}