From d48ed984b0811f163209662ee1f28f54e3931913 Mon Sep 17 00:00:00 2001 From: Atmo Suwiryo Date: Sat, 27 May 2023 13:24:15 +0700 Subject: [PATCH 1/5] removing all typeorm stuff --- .../migration.sql | 20 +++++ .../migration.sql | 10 +++ .../migration.sql | 26 ++++++ prisma/schema.prisma | 49 +++++++++-- src/APIModule.ts | 7 +- src/Bibles/BiblesController.ts | 11 ++- src/Bibles/BiblesService.ts | 51 +++++++---- src/Bibles/Books/BooksService.ts | 81 ++++++++++-------- src/Bibles/Books/Chapters/ChaptersService.ts | 77 +++++++++-------- src/Data/PrismaService.ts | 22 +++++ src/{Models => Dto}/Bibles/BibleCreate.ts | 0 src/Dto/Bibles/Books/BookCreate.ts | 6 ++ src/{Models => Dto}/Bibles/Books/Category.ts | 0 .../Bibles/Books/Chapters/ChapterCreate.ts | 7 ++ .../Books/Chapters/Verses/VerseCreate.ts | 0 src/{Models => Dto}/Bibles/Books/Section.ts | 0 src/{Models => Dto}/Languages/Language.ts | 0 src/{Models => Dto}/Search/QA/QAHitType.ts | 0 src/{Models => Dto}/Search/QA/QARequest.ts | 7 +- .../Search/QA/QAResultStatus.ts | 0 src/{Models => Dto}/Search/SearchOptions.ts | 2 +- src/Models/Bibles/Bible.ts | 20 ----- src/Models/Bibles/Books/Book.ts | 47 ----------- src/Models/Bibles/Books/BookCreate.ts | 7 -- src/Models/Bibles/Books/Chapters/Chapter.ts | 34 -------- .../Bibles/Books/Chapters/ChapterCreate.ts | 9 -- .../Bibles/Books/Chapters/Verses/Verse.ts | 24 ------ src/Models/Entities.ts | 13 --- src/Models/EntityBase.ts | 12 --- src/Models/Search/QA/QAResult.ts | 47 ----------- src/Models/TypeOrmConfig.ts | 18 ---- src/Search/QA/QAController.ts | 4 +- src/Search/QA/QAService.ts | 84 ++++++++++++------- src/Search/SearchController.ts | 19 +++-- src/Search/SearchService.ts | 10 +-- src/Server/Server.ts | 7 ++ test/SeedTest.ts | 4 +- 37 files changed, 344 insertions(+), 391 deletions(-) create mode 100644 prisma/migrations/20230526181949_new_qaresult_model/migration.sql create mode 100644 prisma/migrations/20230526190610_rename_status_field/migration.sql create mode 100644 prisma/migrations/20230526194701_add_qaresult_to_book/migration.sql rename src/{Models => Dto}/Bibles/BibleCreate.ts (100%) create mode 100644 src/Dto/Bibles/Books/BookCreate.ts rename src/{Models => Dto}/Bibles/Books/Category.ts (100%) create mode 100644 src/Dto/Bibles/Books/Chapters/ChapterCreate.ts rename src/{Models => Dto}/Bibles/Books/Chapters/Verses/VerseCreate.ts (100%) rename src/{Models => Dto}/Bibles/Books/Section.ts (100%) rename src/{Models => Dto}/Languages/Language.ts (100%) rename src/{Models => Dto}/Search/QA/QAHitType.ts (100%) rename src/{Models => Dto}/Search/QA/QARequest.ts (51%) rename src/{Models => Dto}/Search/QA/QAResultStatus.ts (100%) rename src/{Models => Dto}/Search/SearchOptions.ts (73%) delete mode 100644 src/Models/Bibles/Bible.ts delete mode 100644 src/Models/Bibles/Books/Book.ts delete mode 100644 src/Models/Bibles/Books/BookCreate.ts delete mode 100644 src/Models/Bibles/Books/Chapters/Chapter.ts delete mode 100644 src/Models/Bibles/Books/Chapters/ChapterCreate.ts delete mode 100644 src/Models/Bibles/Books/Chapters/Verses/Verse.ts delete mode 100644 src/Models/Entities.ts delete mode 100644 src/Models/EntityBase.ts delete mode 100644 src/Models/Search/QA/QAResult.ts delete mode 100644 src/Models/TypeOrmConfig.ts diff --git a/prisma/migrations/20230526181949_new_qaresult_model/migration.sql b/prisma/migrations/20230526181949_new_qaresult_model/migration.sql new file mode 100644 index 0000000..2d114ec --- /dev/null +++ b/prisma/migrations/20230526181949_new_qaresult_model/migration.sql @@ -0,0 +1,20 @@ +-- AlterTable +ALTER TABLE `Verse` MODIFY `content` TEXT NOT NULL; + +-- CreateTable +CREATE TABLE `QAResult` ( + `id` VARCHAR(191) NOT NULL, + `hash` VARCHAR(191) NOT NULL, + `prompt` TEXT NOT NULL, + `answer` TEXT NOT NULL, + `tokens` INTEGER NOT NULL, + `time` INTEGER NOT NULL, + `qaResultStatus` ENUM('ACTIVE', 'EXPIRED', 'BLOCKED', 'FAILED') NOT NULL, + `hit` ENUM('CACHE', 'LIVE') NOT NULL, + `bookId` VARCHAR(191) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `QAResult` ADD CONSTRAINT `QAResult_bookId_fkey` FOREIGN KEY (`bookId`) REFERENCES `Book`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20230526190610_rename_status_field/migration.sql b/prisma/migrations/20230526190610_rename_status_field/migration.sql new file mode 100644 index 0000000..f3690d9 --- /dev/null +++ b/prisma/migrations/20230526190610_rename_status_field/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - You are about to drop the column `qaResultStatus` on the `QAResult` table. All the data in the column will be lost. + - Added the required column `status` to the `QAResult` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `QAResult` DROP COLUMN `qaResultStatus`, + ADD COLUMN `status` ENUM('ACTIVE', 'EXPIRED', 'BLOCKED', 'FAILED') NOT NULL; diff --git a/prisma/migrations/20230526194701_add_qaresult_to_book/migration.sql b/prisma/migrations/20230526194701_add_qaresult_to_book/migration.sql new file mode 100644 index 0000000..9bb66b8 --- /dev/null +++ b/prisma/migrations/20230526194701_add_qaresult_to_book/migration.sql @@ -0,0 +1,26 @@ +/* + Warnings: + + - You are about to drop the column `bookId` on the `QAResult` table. All the data in the column will be lost. + +*/ +-- DropForeignKey +ALTER TABLE `QAResult` DROP FOREIGN KEY `QAResult_bookId_fkey`; + +-- AlterTable +ALTER TABLE `QAResult` DROP COLUMN `bookId`; + +-- CreateTable +CREATE TABLE `QAResultToBook` ( + `id` VARCHAR(191) NOT NULL, + `qAResultId` VARCHAR(191) NOT NULL, + `bookId` VARCHAR(191) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `QAResultToBook` ADD CONSTRAINT `QAResultToBook_qAResultId_fkey` FOREIGN KEY (`qAResultId`) REFERENCES `QAResult`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `QAResultToBook` ADD CONSTRAINT `QAResultToBook_bookId_fkey` FOREIGN KEY (`bookId`) REFERENCES `Book`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index d719b5a..02a3510 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -15,6 +15,18 @@ enum Language { EN } +enum QAResultStatus { + ACTIVE + EXPIRED + BLOCKED + FAILED +} + +enum QAHitType { + CACHE + LIVE +} + model Bible { id String @id @default(uuid()) name String @@ -26,13 +38,14 @@ model Bible { } model Book { - id String @id @default(uuid()) - bible Bible @relation(fields: [bibleId], references: [id]) - bibleId String - name String - description String - Chapter Chapter[] - Verse Verse[] + id String @id @default(uuid()) + bible Bible @relation(fields: [bibleId], references: [id]) + bibleId String + name String + description String + Chapter Chapter[] + Verse Verse[] + QAResultToBook QAResultToBook[] } model Chapter { @@ -55,5 +68,25 @@ model Verse { number Int name String? description String? - content String + content String @db.Text +} + +model QAResult { + id String @id @default(uuid()) + hash String + prompt String @db.Text + answer String @db.Text + tokens Int + time Int + status QAResultStatus + hit QAHitType + QAResultToBook QAResultToBook[] +} + +model QAResultToBook { + id String @id @default(uuid()) + qAResultId String + QAResult QAResult @relation(fields: [qAResultId], references: [id]) + bookId String + Book Book @relation(fields: [bookId], references: [id]) } diff --git a/src/APIModule.ts b/src/APIModule.ts index 3fa6d56..c83d64d 100644 --- a/src/APIModule.ts +++ b/src/APIModule.ts @@ -1,11 +1,10 @@ import { AMQPLogLevel, AMQPModule } from '@nestjs.pro/amqp'; import { Module } from '@nestjs/common'; -import { TypeOrmModule } from '@nestjs/typeorm'; import { BiblesController } from './Bibles/BiblesController'; import { BiblesService } from './Bibles/BiblesService'; import { BooksService } from './Bibles/Books/BooksService'; +import { PrismaService } from './Data/PrismaService'; import { ChaptersService } from './Bibles/Books/Chapters/ChaptersService'; -import { TYPEORM_CONFIG } from './Models/TypeOrmConfig'; import { QAController } from './Search/QA/QAController'; import { QAService } from './Search/QA/QAService'; import { SearchController } from './Search/SearchController'; @@ -13,7 +12,6 @@ import { SearchService } from './Search/SearchService'; @Module({ imports: [ - TypeOrmModule.forRoot(TYPEORM_CONFIG), AMQPModule.forRoot({ logLevel: AMQPLogLevel.ERROR, autoConnect: true, @@ -39,6 +37,7 @@ import { SearchService } from './Search/SearchService'; BooksService, ChaptersService, SearchService, + PrismaService, QAService ], controllers: [ @@ -47,4 +46,4 @@ import { SearchService } from './Search/SearchService'; QAController ] }) -export class APIModule {} +export class APIModule { } diff --git a/src/Bibles/BiblesController.ts b/src/Bibles/BiblesController.ts index b290452..ca64a3e 100644 --- a/src/Bibles/BiblesController.ts +++ b/src/Bibles/BiblesController.ts @@ -1,8 +1,7 @@ import { Body, Controller, Get, Param, ParseUUIDPipe, Post } from '@nestjs/common'; +import { Prisma, Bible } from '@prisma/client'; import { ApiTags } from '@nestjs/swagger'; -import { Observable } from 'rxjs'; -import { Bible } from '../Models/Bibles/Bible'; -import { BibleCreate } from '../Models/Bibles/BibleCreate'; +// import { Observable } from 'rxjs'; import { BiblesService } from './BiblesService'; @ApiTags('Bibles') @@ -11,17 +10,17 @@ export class BiblesController { public constructor(private readonly biblesService: BiblesService) {} @Get('/') - public search(): Observable> { + public search(): Promise> { return this.biblesService.search(); } @Get('/:bibleId([a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12})') - public get(@Param('bibleId', new ParseUUIDPipe({ version: '4' })) bibleId: string): Observable { + public get(@Param('bibleId', new ParseUUIDPipe({ version: '4' })) bibleId: string): Promise { return this.biblesService.getById(bibleId); } @Post('/') - public create(@Body() create: BibleCreate): Observable { + public create(@Body() create: Prisma.BibleCreateInput): Promise { return this.biblesService.create(create); } } diff --git a/src/Bibles/BiblesService.ts b/src/Bibles/BiblesService.ts index 61cc9bb..a61c31a 100644 --- a/src/Bibles/BiblesService.ts +++ b/src/Bibles/BiblesService.ts @@ -1,31 +1,48 @@ import { Injectable } from '@nestjs/common'; -import { Prisma } from '@prisma/client'; -import { from, Observable } from 'rxjs'; -import { DataSource, Repository } from 'typeorm'; +import { Prisma, Bible } from '@prisma/client'; import { PrismaService } from '../Data/PrismaService'; -import { Bible } from '../Models/Bibles/Bible'; -import { BibleCreate } from '../Models/Bibles/BibleCreate'; +// import { from, Observable } from 'rxjs'; @Injectable() export class BiblesService { - public constructor(private readonly prismaSerivce: PrismaService) { + public constructor(private readonly prismaService: PrismaService) { + } + + private _bible(bibleWHereUniqueInput: Prisma.BibleWhereUniqueInput): Promise { + return this.prismaService.bible.findUniqueOrThrow({ + where: bibleWHereUniqueInput, + }) + } + + private _bibles(params: { + skip?: number; + take?: number; + cursor?: Prisma.BibleWhereUniqueInput; + where?: Prisma.BibleWhereInput; + orderBy?: Prisma.BibleOrderByWithRelationInput; + }): Promise { + const { skip, take, cursor, where, orderBy } = params; + return this.prismaService.bible.findMany({ + skip, + take, + cursor, + where, + orderBy, + }) } public search(): Promise> { - return this.prismaSerivce.bible.findMany() + return this._bibles({}); } - public getById(id: string): Observable { - return from( - this.repository.findOneOrFail({ - where: { - id - } - }) - ); + public getById(id: string): Promise { + return this._bible({ id: id }); } - public create(create: BibleCreate): Observable { - return from(this.repository.save(create)); + public create(data: Prisma.BibleCreateInput): Promise { + return this.prismaService.bible.create({ + data, + }) } + } diff --git a/src/Bibles/Books/BooksService.ts b/src/Bibles/Books/BooksService.ts index 1972907..b9248e3 100644 --- a/src/Bibles/Books/BooksService.ts +++ b/src/Bibles/Books/BooksService.ts @@ -1,53 +1,60 @@ import { Injectable } from '@nestjs/common'; -import { from, Observable } from 'rxjs'; -import { DataSource, Repository } from 'typeorm'; -import { Bible } from '../../Models/Bibles/Bible'; -import { BibleCreate } from '../../Models/Bibles/BibleCreate'; -import { Book } from '../../Models/Bibles/Books/Book'; -import { BookCreate } from '../../Models/Bibles/Books/BookCreate'; +import { Prisma, Book } from '@prisma/client'; +import { PrismaService } from '../../Data/PrismaService'; @Injectable() export class BooksService { - private readonly repository: Repository; + public constructor(private readonly prismaService: PrismaService) { } - public constructor(private readonly dataSource: DataSource) { - this.repository = dataSource.getRepository(Book); + private _book(bookWhereUniqueInput: Prisma.BookWhereUniqueInput): Promise { + return this.prismaService.book.findUniqueOrThrow({ + where: bookWhereUniqueInput, + }); } - public search(): Observable> { - return from( - this.repository.find({ - order: { - name: 'ASC' - } - }) - ); + private _books(params: { + skip?: number; + take?: number; + cursor?: Prisma.BookWhereUniqueInput; + where?: Prisma.BookWhereInput; + orderBy?: Prisma.BookOrderByWithRelationInput; + }): Promise> { + const { skip, take, cursor, where, orderBy } = params; + return this.prismaService.book.findMany({ + skip, + take, + cursor, + where, + orderBy, + }); } - public getById(id: string): Observable { - return from( - this.repository.findOneOrFail({ - where: { - id - } - }) - ); + + public search(): Promise> { + return this._books({ orderBy: { name: 'asc' } }) } - public getByName(name: string): Observable { - return from( - this.repository.findOneOrFail({ - where: { - name - } - }) - ); + public getById(id: string): Promise { + return this._book({ id: id }); } - public create(create: BookCreate) { - return this.repository.save({ - bible: create.bible, - number: create.number, + public getByName(name: string): Promise { + // Only if the Book.name is unique, should this be used. + // return this._book({ name: name }); + + // Book.name is not unique, so this will return the first book with the given name. + return this.prismaService.book.findFirstOrThrow({ + where: { + name: name, + }, + }); + } + + + public create(data: Prisma.BookCreateInput): Promise { + + return this.prismaService.book.create({ + data, }); } diff --git a/src/Bibles/Books/Chapters/ChaptersService.ts b/src/Bibles/Books/Chapters/ChaptersService.ts index 507a97c..e31385a 100644 --- a/src/Bibles/Books/Chapters/ChaptersService.ts +++ b/src/Bibles/Books/Chapters/ChaptersService.ts @@ -1,50 +1,59 @@ import { Injectable } from '@nestjs/common'; -import { from, Observable } from 'rxjs'; -import { DataSource, Repository } from 'typeorm'; -import { Chapter } from '../../../Models/Bibles/Books/Chapters/Chapter'; -import { ChapterCreate } from '../../../Models/Bibles/Books/Chapters/ChapterCreate'; +import { Prisma, Chapter } from '@prisma/client'; +import { PrismaService } from '../../../Data/PrismaService'; @Injectable() export class ChaptersService { - private readonly repository: Repository; + public constructor(private readonly prismaService: PrismaService) { } - public constructor(private readonly dataSource: DataSource) { - this.repository = dataSource.getRepository(Chapter); + + private _chapter(chapterWhereUniqueInput: Prisma.ChapterWhereUniqueInput): Promise { + return this.prismaService.chapter.findUniqueOrThrow({ + where: chapterWhereUniqueInput, + }); + } + + private _chapters(params: { + skip?: number; + take?: number; + cursor?: Prisma.ChapterWhereUniqueInput; + where?: Prisma.ChapterWhereInput; + orderBy?: Prisma.ChapterOrderByWithRelationInput; + }): Promise { + const { skip, take, cursor, where, orderBy } = params; + return this.prismaService.chapter.findMany({ + skip, + take, + cursor, + where, + orderBy, + }); } - public search(): Observable> { - return from( - this.repository.find({ - order: { - name: 'ASC' - } - }) - ); + + public search(): Promise> { + return this._chapters({ orderBy: { name: 'asc' } }) } - public getById(id: string): Observable { - return from( - this.repository.findOneOrFail({ - where: { - id - } - }) - ); + public getById(id: string): Promise { + return this._chapter({ id: id }); } - public getByName(name: string): Observable { - return from( - this.repository.findOneOrFail({ - where: { - name - } - }) - ); + public getByName(name: string): Promise { + // Only if the Chapter.name is unique, should this be used. + // return this._chapter({ name: name }); + + // Chapter.name is not unique, so this will return the first book with the given name. + return this.prismaService.chapter.findFirstOrThrow({ + where: { + name: name, + }, + }); } - public create(create: ChapterCreate) { - return this.repository.save({ - number: create.number, + public create(data: Prisma.ChapterCreateInput): Promise { + return this.prismaService.chapter.create({ + data, }); } diff --git a/src/Data/PrismaService.ts b/src/Data/PrismaService.ts index d25bb83..fc2769b 100644 --- a/src/Data/PrismaService.ts +++ b/src/Data/PrismaService.ts @@ -3,10 +3,32 @@ import { PrismaClient } from '@prisma/client'; @Injectable() export class PrismaService extends PrismaClient implements OnModuleInit { + constructor() { + super({ + log: [ + { + emit: 'event', + level: 'query', + }, + ], + }); + } async onModuleInit() { await this.$connect(); } + async enableEventBasedLogging() { + // @ts-ignore + this.$on('query', async (e) => { + // @ts-ignore + console.log('Query: ' + e.query); + // @ts-ignore + console.log('Params: ' + JSON.stringify(e.params)); + // @ts-ignore + console.log('Duration: ' + e.duration + 'ms'); + }); + } + async enableShutdownHooks(app: INestApplication) { this.$on('beforeExit', async () => { await app.close(); diff --git a/src/Models/Bibles/BibleCreate.ts b/src/Dto/Bibles/BibleCreate.ts similarity index 100% rename from src/Models/Bibles/BibleCreate.ts rename to src/Dto/Bibles/BibleCreate.ts diff --git a/src/Dto/Bibles/Books/BookCreate.ts b/src/Dto/Bibles/Books/BookCreate.ts new file mode 100644 index 0000000..84145dc --- /dev/null +++ b/src/Dto/Bibles/Books/BookCreate.ts @@ -0,0 +1,6 @@ +import { Bible } from '@prisma/client'; + +export class BookCreate{ + public bible: Bible; + public number: number; +} diff --git a/src/Models/Bibles/Books/Category.ts b/src/Dto/Bibles/Books/Category.ts similarity index 100% rename from src/Models/Bibles/Books/Category.ts rename to src/Dto/Bibles/Books/Category.ts diff --git a/src/Dto/Bibles/Books/Chapters/ChapterCreate.ts b/src/Dto/Bibles/Books/Chapters/ChapterCreate.ts new file mode 100644 index 0000000..559eab9 --- /dev/null +++ b/src/Dto/Bibles/Books/Chapters/ChapterCreate.ts @@ -0,0 +1,7 @@ +import { Bible, Book } from '@prisma/client'; + +export class ChapterCreate { + public bible: Bible; + public book: Book; + public number: number; +} diff --git a/src/Models/Bibles/Books/Chapters/Verses/VerseCreate.ts b/src/Dto/Bibles/Books/Chapters/Verses/VerseCreate.ts similarity index 100% rename from src/Models/Bibles/Books/Chapters/Verses/VerseCreate.ts rename to src/Dto/Bibles/Books/Chapters/Verses/VerseCreate.ts diff --git a/src/Models/Bibles/Books/Section.ts b/src/Dto/Bibles/Books/Section.ts similarity index 100% rename from src/Models/Bibles/Books/Section.ts rename to src/Dto/Bibles/Books/Section.ts diff --git a/src/Models/Languages/Language.ts b/src/Dto/Languages/Language.ts similarity index 100% rename from src/Models/Languages/Language.ts rename to src/Dto/Languages/Language.ts diff --git a/src/Models/Search/QA/QAHitType.ts b/src/Dto/Search/QA/QAHitType.ts similarity index 100% rename from src/Models/Search/QA/QAHitType.ts rename to src/Dto/Search/QA/QAHitType.ts diff --git a/src/Models/Search/QA/QARequest.ts b/src/Dto/Search/QA/QARequest.ts similarity index 51% rename from src/Models/Search/QA/QARequest.ts rename to src/Dto/Search/QA/QARequest.ts index 1959a9c..bc86bd3 100644 --- a/src/Models/Search/QA/QARequest.ts +++ b/src/Dto/Search/QA/QARequest.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsArray, Length } from 'class-validator'; +import { IsArray, IsOptional, Length } from 'class-validator'; export class QARequest { @ApiProperty() @@ -7,6 +7,7 @@ export class QARequest { public prompt: string; @ApiProperty() - @IsArray({ each: true}) - public books: string[]; + @IsArray({ each: true }) + @IsOptional({ each: true }) + public books?: string[]; } diff --git a/src/Models/Search/QA/QAResultStatus.ts b/src/Dto/Search/QA/QAResultStatus.ts similarity index 100% rename from src/Models/Search/QA/QAResultStatus.ts rename to src/Dto/Search/QA/QAResultStatus.ts diff --git a/src/Models/Search/SearchOptions.ts b/src/Dto/Search/SearchOptions.ts similarity index 73% rename from src/Models/Search/SearchOptions.ts rename to src/Dto/Search/SearchOptions.ts index 04536ef..c25313d 100644 --- a/src/Models/Search/SearchOptions.ts +++ b/src/Dto/Search/SearchOptions.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { Book } from '../Bibles/Books/Book'; +import { Book } from '@prisma/client'; export class SearchOptions { @ApiProperty() diff --git a/src/Models/Bibles/Bible.ts b/src/Models/Bibles/Bible.ts deleted file mode 100644 index 23a52d5..0000000 --- a/src/Models/Bibles/Bible.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { Column, Entity, Unique } from 'typeorm'; -import { EntityBase } from '../EntityBase'; -import { Language } from '../Languages/Language'; - -@Entity('bibles') -@Unique(['name']) -export class Bible extends EntityBase { - @ApiProperty() - @Column() - public name: string; - - @ApiProperty() - @Column() - public description: string; - - @ApiProperty({ enum: Language }) - @Column({ enum: Language }) - public language: Language; -} diff --git a/src/Models/Bibles/Books/Book.ts b/src/Models/Bibles/Books/Book.ts deleted file mode 100644 index 2971529..0000000 --- a/src/Models/Bibles/Books/Book.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { Column, Entity, ManyToMany, ManyToOne, OneToMany, Unique } from 'typeorm'; -import { EntityBase } from '../../EntityBase'; -import { Bible } from '../Bible'; -import { Category } from './Category'; -import { Chapter } from './Chapters/Chapter'; -import { Section } from './Section'; - -@Entity('bibles_books') -@Unique(['bible', 'number']) -export class Book extends EntityBase { - @ApiProperty() - @ManyToOne(() => Bible) - public bible: Bible; - - @ApiProperty() - @Column() - public number: number; - - @ApiProperty() - @Column({ nullable: true}) - public name: string; - - @ApiProperty() - @Column({ nullable: true}) - public description?: string; - - @ApiProperty() - @ManyToMany(() => Chapter, { cascade: true, onUpdate: 'CASCADE'}) - public chapters: Chapter[]; - - /** - * The theme of the book. - * @example "Letters to churches or individuals" - */ - @ApiProperty() - @Column({ nullable: true}) - public theme?: string; - - @ApiProperty({ enum: Section }) - @Column({ nullable: true}) - public section?: Section; - - @ApiProperty({ enum: Category }) - @Column({ nullable: true}) - public category?: Category; -} diff --git a/src/Models/Bibles/Books/BookCreate.ts b/src/Models/Bibles/Books/BookCreate.ts deleted file mode 100644 index 0f1e269..0000000 --- a/src/Models/Bibles/Books/BookCreate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Bible } from '../Bible'; -import { ChapterCreate } from './Chapters/ChapterCreate'; - -export class BookCreate{ - public bible: Bible; - public number: number; -} diff --git a/src/Models/Bibles/Books/Chapters/Chapter.ts b/src/Models/Bibles/Books/Chapters/Chapter.ts deleted file mode 100644 index c0c3389..0000000 --- a/src/Models/Bibles/Books/Chapters/Chapter.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { Column, Entity, ManyToMany, ManyToOne, Unique } from 'typeorm'; -import { EntityBase } from '../../../EntityBase'; -import { Bible } from '../../Bible'; -import { Book } from '../Book'; -import { Verse } from './Verses/Verse'; - -@Entity('bibles_books_chapters') -@Unique(['book', 'name']) -export class Chapter extends EntityBase { - @ApiProperty() - @ManyToOne(() => Bible) - public bible: Bible; - - @ApiProperty() - @ManyToOne(() => Book) - public book: Book; - - @ApiProperty() - @Column() - public number: number; - - @ApiProperty() - @Column({ nullable: true}) - public name: string; - - @ApiProperty() - @Column({ nullable: true}) - public description?: string; - - @ApiProperty() - @ManyToMany(() => Verse, { cascade: true, onUpdate: 'CASCADE'}) - public verses: Verse[]; -} diff --git a/src/Models/Bibles/Books/Chapters/ChapterCreate.ts b/src/Models/Bibles/Books/Chapters/ChapterCreate.ts deleted file mode 100644 index 34159f6..0000000 --- a/src/Models/Bibles/Books/Chapters/ChapterCreate.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Bible } from '../../Bible'; -import { Book } from '../Book'; -import { VerseCreate } from './Verses/VerseCreate'; - -export class ChapterCreate { - public bible: Bible; - public book: Book; - public number: number; -} diff --git a/src/Models/Bibles/Books/Chapters/Verses/Verse.ts b/src/Models/Bibles/Books/Chapters/Verses/Verse.ts deleted file mode 100644 index 2e3d4bf..0000000 --- a/src/Models/Bibles/Books/Chapters/Verses/Verse.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { Column, Entity, ManyToMany, ManyToOne, Unique } from 'typeorm'; -import { EntityBase } from '../../../../EntityBase'; -import { Chapter } from '../Chapter'; - -@Entity('bibles_books_chapters_verses') -@Unique([ 'chapter', 'content' ]) -export class Verse extends EntityBase { - @ApiProperty() - @ManyToOne(() => Chapter) - public chapter?: Chapter; - - @ApiProperty() - @Column() - public number: number; - - @ApiProperty() - @Column({ nullable: true }) - public description?: string; - - @ApiProperty() - @Column() - public content: string; -} diff --git a/src/Models/Entities.ts b/src/Models/Entities.ts deleted file mode 100644 index 6bf94bf..0000000 --- a/src/Models/Entities.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Bible } from './Bibles/Bible'; -import { Book } from './Bibles/Books/Book'; -import { Chapter } from './Bibles/Books/Chapters/Chapter'; -import { Verse } from './Bibles/Books/Chapters/Verses/Verse'; -import { QAResult } from './Search/QA/QAResult'; - -export const ENTITIES = [ - Bible, - Book, - Chapter, - QAResult, - Verse -]; diff --git a/src/Models/EntityBase.ts b/src/Models/EntityBase.ts deleted file mode 100644 index 37cb684..0000000 --- a/src/Models/EntityBase.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CreateDateColumn, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; - -export class EntityBase { - @PrimaryGeneratedColumn('uuid') - public id?: string; - - @CreateDateColumn() - public stampCreated?: Date; - - @UpdateDateColumn() - public stampUpdated?: Date; -} diff --git a/src/Models/Search/QA/QAResult.ts b/src/Models/Search/QA/QAResult.ts deleted file mode 100644 index 206c5ca..0000000 --- a/src/Models/Search/QA/QAResult.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { ApiProperty } from '@nestjs/swagger'; -import { Column, Entity, JoinTable, ManyToMany, Unique } from 'typeorm'; -import { Book } from '../../Bibles/Books/Book'; -import { EntityBase } from '../../EntityBase'; -import { QAHitType } from './QAHitType'; -import { QAResultStatus } from './QAResultStatus'; - -@Entity('search_results_qa') -@Unique(['prompt']) -export class QAResult extends EntityBase { - @ApiProperty() - @Column() - public hash: string; - - @ApiProperty() - @Column() - public prompt: string; - - @ApiProperty() - @Column({ type: 'text' }) - public answer: string; - - @ApiProperty() - @Column() - public tokens: number; - - @ApiProperty() - @Column() - public time: number; - - @ApiProperty({ enum: QAResultStatus }) - @Column() - public status: QAResultStatus; - - @ApiProperty() - @ManyToMany(() => Book, { cascade: true, onUpdate: 'CASCADE'}) - @JoinTable({ - name: 'search_results_qa_books_links', - joinColumn: { name: 'qaResultId', referencedColumnName: 'id' }, - inverseJoinColumn: { name: 'bookId', referencedColumnName: 'id' } - }) - public books: Book[]; - - @ApiProperty() - @Column() - public hit: QAHitType; -} diff --git a/src/Models/TypeOrmConfig.ts b/src/Models/TypeOrmConfig.ts deleted file mode 100644 index 1dc7110..0000000 --- a/src/Models/TypeOrmConfig.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TypeOrmModuleOptions } from '@nestjs/typeorm'; -import { ENTITIES } from './Entities'; - -export const TYPEORM_CONFIG: TypeOrmModuleOptions = { - type: 'mysql', - host: process.env.DB_HOSTNAME, - port: Number.parseInt(process.env.DB_PORT) || 3306, - username: process.env.DB_USERNAME || 'root', - password: process.env.DB_PASSWORD || 'mysql', - database: process.env.DB_NAME || 'convictionsai', - synchronize: process.env.DB_SYNCHRONIZE === 'true', - connectTimeout: 30000, - logging: process.env.DB_LOGGING === 'true', - keepConnectionAlive: true, - entities: ENTITIES, - migrationsTableName: '_migrations', - migrations: ['./migrations/*.ts'] -}; diff --git a/src/Search/QA/QAController.ts b/src/Search/QA/QAController.ts index 96b6a68..d17bfe9 100644 --- a/src/Search/QA/QAController.ts +++ b/src/Search/QA/QAController.ts @@ -1,8 +1,8 @@ import { Body, Controller, ParseBoolPipe, Post, Query } from '@nestjs/common'; import { ApiBody, ApiQuery, ApiTags } from '@nestjs/swagger'; -import { QARequest } from '../../Models/Search/QA/QARequest'; -import { QAResult } from '../../Models/Search/QA/QAResult'; +import { QARequest } from '../../Dto/Search/QA/QARequest'; import { QAService } from './QAService'; +import { Prisma, QAResult } from '@prisma/client'; @ApiTags('Question & Answering') @Controller('/search/qa') diff --git a/src/Search/QA/QAService.ts b/src/Search/QA/QAService.ts index aeb3d32..9fc1053 100644 --- a/src/Search/QA/QAService.ts +++ b/src/Search/QA/QAService.ts @@ -1,43 +1,44 @@ import { Injectable } from '@nestjs/common'; import { Configuration, CreateCompletionResponse, OpenAIApi } from 'openai'; -import { DataSource, Repository } from 'typeorm'; import { BooksService } from '../../Bibles/Books/BooksService'; import { getPromptFromBook } from '../../Data/BookData'; -import { QAHitType } from '../../Models/Search/QA/QAHitType'; -import { QARequest } from '../../Models/Search/QA/QARequest'; -import { QAResult } from '../../Models/Search/QA/QAResult'; -import { QAResultStatus } from '../../Models/Search/QA/QAResultStatus'; +import { QARequest } from '../../Dto/Search/QA/QARequest'; + +import { Prisma, Book, QAResult, QAResultStatus, QAHitType } from '@prisma/client'; +import { PrismaService } from '../../Data/PrismaService'; @Injectable() export class QAService { - private readonly repository: Repository; private readonly openai = new OpenAIApi( new Configuration({ apiKey: process.env.OPENAI_API_KEY }) ); - public constructor(private readonly dataSource: DataSource, - private readonly booksService: BooksService) { - this.repository = dataSource.getRepository(QAResult); - } + public constructor(private readonly prismaService: PrismaService, + private readonly booksService: BooksService) { } - public search() {} + public search() { } - public getById(id: string): Promise { - return this.repository.findOneOrFail({ - where: { - id - } + private _qaResult(qaResultWhereUniqueInput: Prisma.QAResultWhereUniqueInput): Promise { + return this.prismaService.qAResult.findUniqueOrThrow({ + where: qaResultWhereUniqueInput, }); } + public getById(id: string): Promise { + return this._qaResult({ id: id }); + } + + public getByPrompt(prompt: string): Promise { - return this.repository.findOneOrFail({ + + return this.prismaService.qAResult.findFirstOrThrow({ where: { - prompt + prompt: prompt, } - }); + }) + } public async qa(request: QARequest, nocache: boolean): Promise { @@ -77,23 +78,44 @@ export class QAService { } if (response) { + const books = ['4072ab14-d440-485b-b58b-ac295d0ca3ca', 'bd71faa2-b209-473f-a86f-4b1ab8c15a12', 'dc20fe41-9989-44a7-a764-a683fc289fd9']; + const qaResultToBook = books.map((book: string) => { + return { 'bookId': book }; + }); try { - result = await this.repository.save({ - prompt: request.prompt, - answer: response.choices[0].text.trim(), - tokens: response.usage.total_tokens, - status: QAResultStatus.ACTIVE, - time: Date.now() - start, - books: request.books.map(book => { - return { id: book } - }) + result = await this.prismaService.qAResult.create({ + data: { + prompt: prompt, + answer: response.choices[0].text.trim(), + tokens: response.usage.total_tokens, + status: QAResultStatus.ACTIVE, + time: Date.now() - start, + QAResultToBook: { + // create: [ + // { bookId: '1' }, + // { bookId: '2' }, + // { bookId: '3' } + // ] + create: qaResultToBook + }, + hash: 'hash', + hit: QAHitType.LIVE + + } }); return { ...result, hit: QAHitType.LIVE }; } catch (error) { + console.log('Writing to db failed'); + console.log(error); result = await this.getByPrompt(request.prompt); - await this.repository.update(result.id, { - time: Date.now() - start, - answer: response.choices[0].text.trim() + await this.prismaService.qAResult.update({ + where: { + id: result.id + }, + data: { + time: Date.now() - start, + answer: response.choices[0].text.trim() + } }); return { ...(await this.getByPrompt(request.prompt)), diff --git a/src/Search/SearchController.ts b/src/Search/SearchController.ts index 9b54ae2..07ab85a 100644 --- a/src/Search/SearchController.ts +++ b/src/Search/SearchController.ts @@ -1,7 +1,9 @@ -import { Controller, Get } from '@nestjs/common'; +import { Body, Controller, Get, Post } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; +import { QAResult } from '@prisma/client'; import { Observable } from 'rxjs'; -import { SearchOptions } from '../Models/Search/SearchOptions'; +import { QARequest } from '../Dto/Search/QA/QARequest'; +import { SearchOptions } from '../Dto/Search/SearchOptions'; import { SearchService } from './SearchService'; @ApiTags('Search') @@ -9,12 +11,13 @@ import { SearchService } from './SearchService'; export class SearchController { public constructor(private readonly searchService: SearchService) {} - @Get('/options') - public search(): Promise { - return this.searchService.getOptions(); - } + // @Get('/options') + // public search(): Promise { + // return this.searchService.getOptions(); + // } + // @Post('/qa') - // public qa(@Body() request: QARequest): Observable { - // return this.searchService.qa(request).pipe(first()); + // public qa(@Body() request: QARequest): Promise { + // return this.searchService.qa(request, false); // } } diff --git a/src/Search/SearchService.ts b/src/Search/SearchService.ts index c7b3211..222a08c 100644 --- a/src/Search/SearchService.ts +++ b/src/Search/SearchService.ts @@ -1,18 +1,14 @@ import { Injectable } from '@nestjs/common'; import { firstValueFrom, Observable, of } from 'rxjs'; -import { DataSource, Repository } from 'typeorm'; import { BooksService } from '../Bibles/Books/BooksService'; -import { QAResult } from '../Models/Search/QA/QAResult'; -import { SearchOptions } from '../Models/Search/SearchOptions'; +import { Prisma, Book } from '@prisma/client'; @Injectable() export class SearchService { public constructor(private readonly booksService: BooksService) { } - public async getOptions(): Promise { - return { - books: await firstValueFrom(this.booksService.search()) - } + public async getOptions(): Promise> { + return await this.booksService.search() } } diff --git a/src/Server/Server.ts b/src/Server/Server.ts index 15a5dae..2bba6f8 100644 --- a/src/Server/Server.ts +++ b/src/Server/Server.ts @@ -3,6 +3,7 @@ import { NestExpressApplication } from '@nestjs/platform-express'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import * as bodyParser from 'body-parser'; import * as dotenv from 'dotenv'; +import { PrismaService } from '../Data/PrismaService'; import { ServerConfig } from './ServerConfig'; dotenv.config(); @@ -11,6 +12,12 @@ export class Server { public static async bootstrap(config: ServerConfig): Promise { const app = await NestFactory.create(config.module, config.options); + const prismaService = app.get(PrismaService); + + await prismaService.enableEventBasedLogging(); + + await prismaService.enableShutdownHooks(app); + if (config.cors) { app.enableCors(config.cors); } diff --git a/test/SeedTest.ts b/test/SeedTest.ts index 946fefd..99c47aa 100644 --- a/test/SeedTest.ts +++ b/test/SeedTest.ts @@ -6,8 +6,8 @@ import { APIModule } from '../src/APIModule'; import { BiblesService } from '../src/Bibles/BiblesService'; import { BooksService } from '../src/Bibles/Books/BooksService'; import { ChaptersService } from '../src/Bibles/Books/Chapters/ChaptersService'; -import { Bible } from '../src/Models/Bibles/Bible'; -import { Language } from '../src/Models/Languages/Language'; +import { Bible } from '../src/Dto/Bibles/Bible'; +import { Language } from '../src/Dto/Languages/Language'; const data = require('/Users/matthewdavis/workspace/convictions.ai/data/bible/json/en_kjv.json'); From f8d47f813730ba385eede07bd1356c3677803e08 Mon Sep 17 00:00:00 2001 From: Atmo Suwiryo Date: Sat, 27 May 2023 15:12:19 +0700 Subject: [PATCH 2/5] bump --- package-lock.json | 1012 +++------------------------------ package.json | 4 +- src/Data/PrismaService.ts | 13 +- src/Search/QA/QAController.ts | 2 +- src/Search/QA/QAService.ts | 2 +- src/Server/Server.ts | 2 +- 6 files changed, 91 insertions(+), 944 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0f3e8c1..ddff6b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "@nestjs/core": "^9.0.9", "@nestjs/platform-express": "^9.3.12", "@nestjs/swagger": "^6.0.5", - "@nestjs/typeorm": "^9.0.1", "@prisma/client": "^4.12.0", "amqplib": "^0.10.2", "aws-sdk": "^2.1214.0", @@ -28,8 +27,7 @@ "mysql": "^2.18.1", "openai": "^3.2.1", "rxjs": "^7.5.6", - "swagger-ui-express": "^4.5.0", - "typeorm": "^0.3.7" + "swagger-ui-express": "^4.5.0" }, "devDependencies": { "@nestjs/testing": "^9.0.9", @@ -1536,29 +1534,6 @@ } } }, - "node_modules/@nestjs/typeorm": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-9.0.1.tgz", - "integrity": "sha512-A2BgLIPsMtmMI0bPKEf4bmzgFPsnvHqNBx3KkvaJ7hJrBQy0OqYOb+Rr06ifblKWDWS2tUPNrAFQbZjtk3PI+g==", - "dependencies": { - "uuid": "8.3.2" - }, - "peerDependencies": { - "@nestjs/common": "^8.0.0 || ^9.0.0", - "@nestjs/core": "^8.0.0 || ^9.0.0", - "reflect-metadata": "^0.1.13", - "rxjs": "^7.2.0", - "typeorm": "^0.3.0" - } - }, - "node_modules/@nestjs/typeorm/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@nuxtjs/opencollective": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", @@ -1653,11 +1628,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "node_modules/@sqltools/formatter": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.3.tgz", - "integrity": "sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg==" - }, "node_modules/@types/amqplib": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.8.2.tgz", @@ -1921,6 +1891,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -1939,11 +1910,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "node_modules/anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -1957,14 +1923,6 @@ "node": ">= 8" } }, - "node_modules/app-root-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", - "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==", - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -2177,7 +2135,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -2268,6 +2227,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2334,29 +2294,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2367,16 +2304,6 @@ "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" }, - "node_modules/buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "optional": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -2519,35 +2446,11 @@ "validator": "^13.7.0" } }, - "node_modules/cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "dependencies": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "bin": { - "highlight": "bin/highlight" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, - "node_modules/cli-highlight/node_modules/parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -2647,7 +2550,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/concat-stream": { "version": "1.6.2", @@ -2998,7 +2902,8 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/encodeurl": { "version": "1.0.2", @@ -3073,6 +2978,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "engines": { "node": ">=6" } @@ -3378,7 +3284,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -3437,6 +3344,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -3494,6 +3402,7 @@ "version": "7.2.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3608,14 +3517,6 @@ "node": ">=8" } }, - "node_modules/highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "engines": { - "node": "*" - } - }, "node_modules/hpagent": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", @@ -3662,25 +3563,6 @@ "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -3719,6 +3601,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3859,6 +3742,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -4977,6 +4861,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4989,17 +4874,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -5087,16 +4961,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5343,6 +5207,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5430,13 +5295,6 @@ "node": ">=6" } }, - "node_modules/packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==", - "optional": true, - "peer": true - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5455,19 +5313,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "dependencies": { - "parse5": "^6.0.1" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -5489,6 +5334,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5513,94 +5359,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==" }, - "node_modules/pg": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", - "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", - "optional": true, - "peer": true, - "dependencies": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", - "pg-protocol": "^1.5.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } - } - }, - "node_modules/pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==", - "optional": true, - "peer": true - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "optional": true, - "peer": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", - "optional": true, - "peer": true, - "peerDependencies": { - "pg": ">=8.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==", - "optional": true, - "peer": true - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "optional": true, - "peer": true, - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "optional": true, - "peer": true, - "dependencies": { - "split2": "^4.1.0" - } - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -5640,49 +5398,6 @@ "node": ">=8" } }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "optional": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "optional": true, - "peer": true, - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/prettier": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", @@ -5871,7 +5586,8 @@ "node_modules/reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "peer": true }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", @@ -5893,6 +5609,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5996,11 +5713,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, "node_modules/secure-json-parse": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.5.0.tgz", @@ -6062,18 +5774,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6181,16 +5881,6 @@ "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", "dev": true }, - "node_modules/split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", - "optional": true, - "peer": true, - "engines": { - "node": ">= 10.x" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -6255,6 +5945,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6294,6 +5985,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6524,25 +6216,6 @@ "node": ">=8" } }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -6685,190 +6358,29 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" - }, - "node_modules/typeorm": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.11.tgz", - "integrity": "sha512-pzdOyWbVuz/z8Ww6gqvBW4nylsM0KLdUCDExr2gR20/x1khGSVxQkjNV/3YqliG90jrWzrknYbYscpk8yxFJVg==", - "dependencies": { - "@sqltools/formatter": "^1.2.2", - "app-root-path": "^3.0.0", - "buffer": "^6.0.3", - "chalk": "^4.1.0", - "cli-highlight": "^2.1.11", - "date-fns": "^2.28.0", - "debug": "^4.3.3", - "dotenv": "^16.0.0", - "glob": "^7.2.0", - "js-yaml": "^4.1.0", - "mkdirp": "^1.0.4", - "reflect-metadata": "^0.1.13", - "sha.js": "^2.4.11", - "tslib": "^2.3.1", - "uuid": "^8.3.2", - "xml2js": "^0.4.23", - "yargs": "^17.3.1" - }, - "bin": { - "typeorm": "cli.js", - "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", - "typeorm-ts-node-esm": "cli-ts-node-esm.js" - }, - "engines": { - "node": ">= 12.9.0" - }, - "funding": { - "url": "https://opencollective.com/typeorm" - }, - "peerDependencies": { - "@google-cloud/spanner": "^5.18.0", - "@sap/hana-client": "^2.12.25", - "better-sqlite3": "^7.1.2 || ^8.0.0", - "hdb-pool": "^0.1.6", - "ioredis": "^5.0.4", - "mongodb": "^3.6.0", - "mssql": "^7.3.0", - "mysql2": "^2.2.5", - "oracledb": "^5.1.0", - "pg": "^8.5.1", - "pg-native": "^3.0.0", - "pg-query-stream": "^4.0.0", - "redis": "^3.1.1 || ^4.0.0", - "sql.js": "^1.4.0", - "sqlite3": "^5.0.3", - "ts-node": "^10.7.0", - "typeorm-aurora-data-api-driver": "^2.0.0" - }, - "peerDependenciesMeta": { - "@google-cloud/spanner": { - "optional": true - }, - "@sap/hana-client": { - "optional": true - }, - "better-sqlite3": { - "optional": true - }, - "hdb-pool": { - "optional": true - }, - "ioredis": { - "optional": true - }, - "mongodb": { - "optional": true - }, - "mssql": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "oracledb": { - "optional": true - }, - "pg": { - "optional": true - }, - "pg-native": { - "optional": true - }, - "pg-query-stream": { - "optional": true - }, - "redis": { - "optional": true - }, - "sql.js": { - "optional": true - }, - "sqlite3": { - "optional": true - }, - "ts-node": { - "optional": true - }, - "typeorm-aurora-data-api-driver": { - "optional": true - } - } - }, - "node_modules/typeorm/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/typeorm/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/typeorm/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typeorm/node_modules/yargs": { - "version": "17.5.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.0.tgz", - "integrity": "sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A==", + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "media-typer": "0.3.0", + "mime-types": "~2.1.24" }, "engines": { - "node": ">=12" + "node": ">= 0.6" } }, - "node_modules/typeorm/node_modules/yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", - "engines": { - "node": ">=12" - } + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { "version": "4.7.4", @@ -7101,6 +6613,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -7116,7 +6629,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.1", @@ -7131,26 +6645,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "engines": { - "node": ">=4.0" - } - }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -7163,6 +6657,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "engines": { "node": ">=10" } @@ -7173,31 +6668,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "engines": { - "node": ">=10" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -8295,21 +7765,6 @@ "tslib": "2.4.0" } }, - "@nestjs/typeorm": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-9.0.1.tgz", - "integrity": "sha512-A2BgLIPsMtmMI0bPKEf4bmzgFPsnvHqNBx3KkvaJ7hJrBQy0OqYOb+Rr06ifblKWDWS2tUPNrAFQbZjtk3PI+g==", - "requires": { - "uuid": "8.3.2" - }, - "dependencies": { - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, "@nuxtjs/opencollective": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", @@ -8384,11 +7839,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "@sqltools/formatter": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.3.tgz", - "integrity": "sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg==" - }, "@types/amqplib": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.8.2.tgz", @@ -8639,7 +8089,8 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, "ansi-styles": { "version": "4.3.0", @@ -8649,11 +8100,6 @@ "color-convert": "^2.0.1" } }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -8664,11 +8110,6 @@ "picomatch": "^2.0.4" } }, - "app-root-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", - "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==" - }, "append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -8847,7 +8288,8 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "base64-js": { "version": "1.5.1", @@ -8915,6 +8357,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8959,15 +8402,6 @@ "node-int64": "^0.4.0" } }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -8978,13 +8412,6 @@ "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" }, - "buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "optional": true, - "peer": true - }, "busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -9082,30 +8509,11 @@ "validator": "^13.7.0" } }, - "cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "requires": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "dependencies": { - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" - } - } - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -9188,7 +8596,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", @@ -9465,7 +8874,8 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "encodeurl": { "version": "1.0.2", @@ -9524,7 +8934,8 @@ "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true }, "escape-html": { "version": "1.0.3", @@ -9756,7 +9167,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -9795,7 +9207,8 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true }, "get-intrinsic": { "version": "1.1.2", @@ -9832,6 +9245,7 @@ "version": "7.2.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -9907,11 +9321,6 @@ "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", "dev": true }, - "highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" - }, "hpagent": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", @@ -9949,11 +9358,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -9980,6 +9384,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -10077,7 +9482,8 @@ "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true }, "is-generator-fn": { "version": "2.1.0", @@ -10909,6 +10315,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -10918,11 +10325,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -11002,16 +10404,6 @@ } } }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -11192,6 +10584,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -11259,13 +10652,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==", - "optional": true, - "peer": true - }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -11278,19 +10664,6 @@ "lines-and-columns": "^1.1.6" } }, - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" - }, - "parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "requires": { - "parse5": "^6.0.1" - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -11305,7 +10678,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "3.1.1", @@ -11324,75 +10698,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==" }, - "pg": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", - "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", - "optional": true, - "peer": true, - "requires": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", - "pg-protocol": "^1.5.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - } - }, - "pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==", - "optional": true, - "peer": true - }, - "pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "optional": true, - "peer": true - }, - "pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", - "optional": true, - "peer": true, - "requires": {} - }, - "pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==", - "optional": true, - "peer": true - }, - "pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "optional": true, - "peer": true, - "requires": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - } - }, - "pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "optional": true, - "peer": true, - "requires": { - "split2": "^4.1.0" - } - }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -11420,37 +10725,6 @@ "find-up": "^4.0.0" } }, - "postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "optional": true, - "peer": true - }, - "postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "optional": true, - "peer": true - }, - "postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "optional": true, - "peer": true - }, - "postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "optional": true, - "peer": true, - "requires": { - "xtend": "^4.0.0" - } - }, "prettier": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", @@ -11590,7 +10864,8 @@ "reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "peer": true }, "regexp.prototype.flags": { "version": "1.4.3", @@ -11605,7 +10880,8 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true }, "requires-port": { "version": "1.0.0", @@ -11671,11 +10947,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, "secure-json-parse": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.5.0.tgz", @@ -11730,15 +11001,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -11827,13 +11089,6 @@ "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", "dev": true }, - "split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", - "optional": true, - "peer": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -11883,6 +11138,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -11913,6 +11169,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -12074,22 +11331,6 @@ "minimatch": "^3.0.4" } }, - "thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -12195,69 +11436,6 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, - "typeorm": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.11.tgz", - "integrity": "sha512-pzdOyWbVuz/z8Ww6gqvBW4nylsM0KLdUCDExr2gR20/x1khGSVxQkjNV/3YqliG90jrWzrknYbYscpk8yxFJVg==", - "requires": { - "@sqltools/formatter": "^1.2.2", - "app-root-path": "^3.0.0", - "buffer": "^6.0.3", - "chalk": "^4.1.0", - "cli-highlight": "^2.1.11", - "date-fns": "^2.28.0", - "debug": "^4.3.3", - "dotenv": "^16.0.0", - "glob": "^7.2.0", - "js-yaml": "^4.1.0", - "mkdirp": "^1.0.4", - "reflect-metadata": "^0.1.13", - "sha.js": "^2.4.11", - "tslib": "^2.3.1", - "uuid": "^8.3.2", - "xml2js": "^0.4.23", - "yargs": "^17.3.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "yargs": { - "version": "17.5.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.0.tgz", - "integrity": "sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" - } - } - }, "typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", @@ -12429,6 +11607,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -12438,7 +11617,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write-file-atomic": { "version": "4.0.1", @@ -12450,20 +11630,6 @@ "signal-exit": "^3.0.7" } }, - "xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - } - }, - "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -12472,7 +11638,8 @@ "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true }, "yallist": { "version": "4.0.0", @@ -12480,25 +11647,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 2666a72..20a1b55 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "@nestjs/core": "^9.0.9", "@nestjs/platform-express": "^9.3.12", "@nestjs/swagger": "^6.0.5", - "@nestjs/typeorm": "^9.0.1", "@prisma/client": "^4.12.0", "amqplib": "^0.10.2", "aws-sdk": "^2.1214.0", @@ -31,8 +30,7 @@ "mysql": "^2.18.1", "openai": "^3.2.1", "rxjs": "^7.5.6", - "swagger-ui-express": "^4.5.0", - "typeorm": "^0.3.7" + "swagger-ui-express": "^4.5.0" }, "devDependencies": { "@nestjs/testing": "^9.0.9", diff --git a/src/Data/PrismaService.ts b/src/Data/PrismaService.ts index fc2769b..740c1bb 100644 --- a/src/Data/PrismaService.ts +++ b/src/Data/PrismaService.ts @@ -1,5 +1,5 @@ import { INestApplication, Injectable, OnModuleInit } from '@nestjs/common'; -import { PrismaClient } from '@prisma/client'; +import { Prisma, PrismaClient } from '@prisma/client'; @Injectable() export class PrismaService extends PrismaClient implements OnModuleInit { @@ -13,18 +13,17 @@ export class PrismaService extends PrismaClient implements OnModuleInit { ], }); } + async onModuleInit() { await this.$connect(); } - async enableEventBasedLogging() { + async subscribeToEventBasedLogging() { + // @ts-ignore - this.$on('query', async (e) => { - // @ts-ignore + this.$on('query', async (e: Prisma.QueryEvent) => { console.log('Query: ' + e.query); - // @ts-ignore console.log('Params: ' + JSON.stringify(e.params)); - // @ts-ignore console.log('Duration: ' + e.duration + 'ms'); }); } @@ -35,3 +34,5 @@ export class PrismaService extends PrismaClient implements OnModuleInit { }); } } + +// Logging Reference: https://www.prisma.io/docs/concepts/components/prisma-client/logging diff --git a/src/Search/QA/QAController.ts b/src/Search/QA/QAController.ts index d17bfe9..4795eeb 100644 --- a/src/Search/QA/QAController.ts +++ b/src/Search/QA/QAController.ts @@ -2,7 +2,7 @@ import { Body, Controller, ParseBoolPipe, Post, Query } from '@nestjs/common'; import { ApiBody, ApiQuery, ApiTags } from '@nestjs/swagger'; import { QARequest } from '../../Dto/Search/QA/QARequest'; import { QAService } from './QAService'; -import { Prisma, QAResult } from '@prisma/client'; +import { QAResult } from '@prisma/client'; @ApiTags('Question & Answering') @Controller('/search/qa') diff --git a/src/Search/QA/QAService.ts b/src/Search/QA/QAService.ts index 9fc1053..3bfe1be 100644 --- a/src/Search/QA/QAService.ts +++ b/src/Search/QA/QAService.ts @@ -4,7 +4,7 @@ import { BooksService } from '../../Bibles/Books/BooksService'; import { getPromptFromBook } from '../../Data/BookData'; import { QARequest } from '../../Dto/Search/QA/QARequest'; -import { Prisma, Book, QAResult, QAResultStatus, QAHitType } from '@prisma/client'; +import { Prisma, QAResult, QAResultStatus, QAHitType } from '@prisma/client'; import { PrismaService } from '../../Data/PrismaService'; @Injectable() diff --git a/src/Server/Server.ts b/src/Server/Server.ts index 2bba6f8..757cafb 100644 --- a/src/Server/Server.ts +++ b/src/Server/Server.ts @@ -14,7 +14,7 @@ export class Server { const prismaService = app.get(PrismaService); - await prismaService.enableEventBasedLogging(); + await prismaService.subscribeToEventBasedLogging(); await prismaService.enableShutdownHooks(app); From 35716ea40b902f6789c455727fd6d415331d5651 Mon Sep 17 00:00:00 2001 From: Atmo Suwiryo Date: Sun, 28 May 2023 00:25:58 +0700 Subject: [PATCH 3/5] Seed db with bible and books --- package.json | 3 + .../migration.sql | 8 + .../migration.sql | 41 +++ prisma/schema.prisma | 16 +- prisma/seed.ts | 27 ++ prisma/seeds/bible.ts | 11 + prisma/seeds/books.ts | 267 ++++++++++++++++++ src/APIModule.ts | 2 + src/Bibles/Books/BooksController.ts | 53 ++++ src/Dto/Bibles/Books/BookRequest.ts | 17 ++ src/Search/QA/QAService.ts | 34 ++- src/Server/Server.ts | 3 +- 12 files changed, 463 insertions(+), 19 deletions(-) create mode 100644 prisma/migrations/20230527140234_add_unique_bible_namelang/migration.sql create mode 100644 prisma/migrations/20230527153405_add_cascading_on_relations/migration.sql create mode 100644 prisma/seed.ts create mode 100644 prisma/seeds/bible.ts create mode 100644 prisma/seeds/books.ts create mode 100644 src/Bibles/Books/BooksController.ts create mode 100644 src/Dto/Bibles/Books/BookRequest.ts diff --git a/package.json b/package.json index 20a1b55..3cfcb54 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "@convictionsai/api", "version": "0.0.1", "private": true, + "prisma": { + "seed": "ts-node prisma/seed.ts" + }, "scripts": { "build": "tsc", "start:local": "concurrently --handle-input \"wait-on dist/main.js && ENVIRONMENT=local nodemon dist/main.js\" \"tsc -w -p tsconfig.json\" ", diff --git a/prisma/migrations/20230527140234_add_unique_bible_namelang/migration.sql b/prisma/migrations/20230527140234_add_unique_bible_namelang/migration.sql new file mode 100644 index 0000000..a354560 --- /dev/null +++ b/prisma/migrations/20230527140234_add_unique_bible_namelang/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - A unique constraint covering the columns `[name,language]` on the table `Bible` will be added. If there are existing duplicate values, this will fail. + +*/ +-- CreateIndex +CREATE UNIQUE INDEX `Bible_name_language_key` ON `Bible`(`name`, `language`); diff --git a/prisma/migrations/20230527153405_add_cascading_on_relations/migration.sql b/prisma/migrations/20230527153405_add_cascading_on_relations/migration.sql new file mode 100644 index 0000000..6742121 --- /dev/null +++ b/prisma/migrations/20230527153405_add_cascading_on_relations/migration.sql @@ -0,0 +1,41 @@ +-- DropForeignKey +ALTER TABLE `Book` DROP FOREIGN KEY `Book_bibleId_fkey`; + +-- DropForeignKey +ALTER TABLE `Chapter` DROP FOREIGN KEY `Chapter_bibleId_fkey`; + +-- DropForeignKey +ALTER TABLE `Chapter` DROP FOREIGN KEY `Chapter_bookId_fkey`; + +-- DropForeignKey +ALTER TABLE `QAResultToBook` DROP FOREIGN KEY `QAResultToBook_bookId_fkey`; + +-- DropForeignKey +ALTER TABLE `QAResultToBook` DROP FOREIGN KEY `QAResultToBook_qAResultId_fkey`; + +-- DropForeignKey +ALTER TABLE `Verse` DROP FOREIGN KEY `Verse_bibleId_fkey`; + +-- DropForeignKey +ALTER TABLE `Verse` DROP FOREIGN KEY `Verse_bookId_fkey`; + +-- AddForeignKey +ALTER TABLE `Book` ADD CONSTRAINT `Book_bibleId_fkey` FOREIGN KEY (`bibleId`) REFERENCES `Bible`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Chapter` ADD CONSTRAINT `Chapter_bibleId_fkey` FOREIGN KEY (`bibleId`) REFERENCES `Bible`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Chapter` ADD CONSTRAINT `Chapter_bookId_fkey` FOREIGN KEY (`bookId`) REFERENCES `Book`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Verse` ADD CONSTRAINT `Verse_bibleId_fkey` FOREIGN KEY (`bibleId`) REFERENCES `Bible`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Verse` ADD CONSTRAINT `Verse_bookId_fkey` FOREIGN KEY (`bookId`) REFERENCES `Book`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `QAResultToBook` ADD CONSTRAINT `QAResultToBook_qAResultId_fkey` FOREIGN KEY (`qAResultId`) REFERENCES `QAResult`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `QAResultToBook` ADD CONSTRAINT `QAResultToBook_bookId_fkey` FOREIGN KEY (`bookId`) REFERENCES `Book`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 02a3510..5ec6dd9 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -35,11 +35,13 @@ model Bible { Book Book[] Chapter Chapter[] Verse Verse[] + + @@unique([name, language]) } model Book { id String @id @default(uuid()) - bible Bible @relation(fields: [bibleId], references: [id]) + bible Bible @relation(fields: [bibleId], references: [id], onDelete: Cascade, onUpdate: Cascade) bibleId String name String description String @@ -50,9 +52,9 @@ model Book { model Chapter { id String @id @default(uuid()) - bible Bible @relation(fields: [bibleId], references: [id]) + bible Bible @relation(fields: [bibleId], references: [id], onDelete: Cascade, onUpdate: Cascade) bibleId String - book Book @relation(fields: [bookId], references: [id]) + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade, onUpdate: Cascade) bookId String number Int name String? @@ -61,9 +63,9 @@ model Chapter { model Verse { id String @id @default(uuid()) - bible Bible @relation(fields: [bibleId], references: [id]) + bible Bible @relation(fields: [bibleId], references: [id], onDelete: Cascade, onUpdate: Cascade) bibleId String - book Book @relation(fields: [bookId], references: [id]) + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade, onUpdate: Cascade) bookId String number Int name String? @@ -86,7 +88,7 @@ model QAResult { model QAResultToBook { id String @id @default(uuid()) qAResultId String - QAResult QAResult @relation(fields: [qAResultId], references: [id]) + QAResult QAResult @relation(fields: [qAResultId], references: [id], onDelete: Cascade, onUpdate: Cascade) bookId String - Book Book @relation(fields: [bookId], references: [id]) + Book Book @relation(fields: [bookId], references: [id], onDelete: Cascade, onUpdate: Cascade) } diff --git a/prisma/seed.ts b/prisma/seed.ts new file mode 100644 index 0000000..9183e8e --- /dev/null +++ b/prisma/seed.ts @@ -0,0 +1,27 @@ +import { PrismaClient, Language } from '@prisma/client' +import { Bible } from './seeds/bible' + +const prisma = new PrismaClient() + +async function main() { + const kjv = await prisma.bible.upsert({ + where: { + name_language: { + name: 'KJV', + language: Language.EN + } + }, + update: {}, + create: Bible + }) + console.log({ kjv }) +} +main() + .then(async () => { + await prisma.$disconnect() + }) + .catch(async (e) => { + console.error(e) + await prisma.$disconnect() + process.exit(1) + }) diff --git a/prisma/seeds/bible.ts b/prisma/seeds/bible.ts new file mode 100644 index 0000000..cebd6bf --- /dev/null +++ b/prisma/seeds/bible.ts @@ -0,0 +1,11 @@ +import { Books } from './books' +import { Language } from '@prisma/client' + +export const Bible = { + name: 'KJV', + language: Language.EN, + description: 'King James Version (KJV)', + Book: { + create: Books + } +} diff --git a/prisma/seeds/books.ts b/prisma/seeds/books.ts new file mode 100644 index 0000000..6b1d853 --- /dev/null +++ b/prisma/seeds/books.ts @@ -0,0 +1,267 @@ +export const Books = [ + { + name: 'Genesis', + description: 'The first book of the Bible', + }, + { + name: 'Exodus', + description: 'The second book of the Bible', + }, + { + name: 'Leviticus', + description: 'The third book of the Bible', + }, + { + name: 'Numbers', + description: 'The fourth book of the Bible', + }, + { + name: 'Deuteronomy', + description: 'The fifth book of the Bible', + }, + { + name: 'Joshua', + description: 'The sixth book of the Bible', + }, + { + name: 'Judges', + description: 'The seventh book of the Bible', + }, + { + name: 'Ruth', + description: 'The eighth book of the Bible', + }, + { + name: '1 Samuel', + description: 'The ninth book of the Bible', + }, + { + name: '2 Samuel', + description: 'The tenth book of the Bible', + }, + { + name: '1 Kings', + description: 'The eleventh book of the Bible', + }, + { + name: '2 Kings', + description: 'The twelfth book of the Bible', + }, + { + name: '1 Chronicles', + description: 'The thirteenth book of the Bible', + }, + { + name: '2 Chronicles', + description: 'The fourteenth book of the Bible', + }, + { + name: 'Ezra', + description: 'The fifteenth book of the Bible', + }, + { + name: 'Nehemiah', + description: 'The sixteenth book of the Bible', + }, + { + name: 'Esther', + description: 'The seventeenth book of the Bible', + }, + { + name: 'Job', + description: 'The eighteenth book of the Bible', + }, + { + name: 'Psalms', + description: 'The nineteenth book of the Bible', + }, + { + name: 'Proverbs', + description: 'The twentieth book of the Bible', + }, + { + name: 'Ecclesiastes', + description: 'The twenty-first book of the Bible', + }, + { + name: 'Song of Solomon', + description: 'The twenty-second book of the Bible', + }, + { + name: 'Isaiah', + description: 'The twenty-third book of the Bible', + }, + { + name: 'Jeremiah', + description: 'The twenty-fourth book of the Bible', + }, + { + name: 'Lamentations', + description: 'The twenty-fifth book of the Bible', + }, + { + name: 'Ezekiel', + description: 'The twenty-sixth book of the Bible', + }, + { + name: 'Daniel', + description: 'The twenty-seventh book of the Bible', + }, + { + name: 'Hosea', + description: 'The twenty-eighth book of the Bible', + }, + { + name: 'Joel', + description: 'The twenty-ninth book of the Bible', + }, + { + name: 'Amos', + description: 'The thirtieth book of the Bible', + }, + { + name: 'Obadiah', + description: 'The thirty-first book of the Bible', + }, + { + name: 'Jonah', + description: 'The thirty-second book of the Bible', + }, + { + name: 'Micah', + description: 'The thirty-third book of the Bible', + }, + { + name: 'Nahum', + description: 'The thirty-fourth book of the Bible', + }, + { + name: 'Habakkuk', + description: 'The thirty-fifth book of the Bible', + }, + { + name: 'Zephaniah', + description: 'The thirty-sixth book of the Bible', + }, + { + name: 'Haggai', + description: 'The thirty-seventh book of the Bible', + }, + { + name: 'Zechariah', + description: 'The thirty-eighth book of the Bible', + }, + { + name: 'Malachi', + description: 'The thirty-ninth book of the Bible', + }, + { + name: 'Matthew', + description: 'The fortieth book of the Bible', + }, + { + name: 'Mark', + description: 'The forty-first book of the Bible', + }, + { + name: 'Luke', + description: 'The forty-second book of the Bible', + }, + { + name: 'John', + description: 'The forty-third book of the Bible', + }, + { + name: 'Acts', + description: 'The forty-fourth book of the Bible', + }, + { + name: 'Romans', + description: 'The forty-fifth book of the Bible', + }, + { + name: '1 Corinthians', + description: 'The forty-sixth book of the Bible', + }, + { + name: '2 Corinthians', + description: 'The forty-seventh book of the Bible', + }, + { + name: 'Galatians', + description: 'The forty-eighth book of the Bible', + }, + { + name: 'Ephesians', + description: 'The forty-ninth book of the Bible', + }, + { + name: 'Philippians', + description: 'The fiftieth book of the Bible', + }, + { + name: 'Colossians', + description: 'The fifty-first book of the Bible', + }, + { + name: '1 Thessalonians', + description: 'The fifty-second book of the Bible', + }, + { + name: '2 Thessalonians', + description: 'The fifty-third book of the Bible', + }, + { + name: '1 Timothy', + description: 'The fifty-fourth book of the Bible', + }, + { + name: '2 Timothy', + description: 'The fifty-fifth book of the Bible', + }, + { + name: 'Titus', + description: 'The fifty-sixth book of the Bible', + }, + { + name: 'Philemon', + description: 'The fifty-seventh book of the Bible', + }, + { + name: 'Hebrews', + description: 'The fifty-eighth book of the Bible', + }, + { + name: 'James', + description: 'The fifty-ninth book of the Bible', + }, + { + name: '1 Peter', + description: 'The sixtieth book of the Bible', + }, + { + name: '2 Peter', + description: 'The sixty-first book of the Bible', + }, + { + name: '1 John', + description: 'The sixty-second book of the Bible', + }, + { + name: '2 John', + description: 'The sixty-third book of the Bible', + }, + { + name: '3 John', + description: 'The sixty-fourth book of the Bible', + }, + { + name: 'Jude', + description: 'The sixty-fifth book of the Bible', + }, + { + name: 'Revelation', + description: 'The sixty-sixth book of the Bible', + } + +] diff --git a/src/APIModule.ts b/src/APIModule.ts index c83d64d..94f10d0 100644 --- a/src/APIModule.ts +++ b/src/APIModule.ts @@ -2,6 +2,7 @@ import { AMQPLogLevel, AMQPModule } from '@nestjs.pro/amqp'; import { Module } from '@nestjs/common'; import { BiblesController } from './Bibles/BiblesController'; import { BiblesService } from './Bibles/BiblesService'; +import { BooksController } from './Bibles/Books/BooksController'; import { BooksService } from './Bibles/Books/BooksService'; import { PrismaService } from './Data/PrismaService'; import { ChaptersService } from './Bibles/Books/Chapters/ChaptersService'; @@ -42,6 +43,7 @@ import { SearchService } from './Search/SearchService'; ], controllers: [ BiblesController, + BooksController, SearchController, QAController ] diff --git a/src/Bibles/Books/BooksController.ts b/src/Bibles/Books/BooksController.ts new file mode 100644 index 0000000..33a0c5b --- /dev/null +++ b/src/Bibles/Books/BooksController.ts @@ -0,0 +1,53 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common'; +import { Prisma, Book } from '@prisma/client'; +import { ApiTags, ApiOperation, ApiOkResponse } from '@nestjs/swagger'; +import { BooksService } from './BooksService'; +import { BookRequest } from '../../Dto/Bibles/Books/BookRequest'; +// import { UUID } from 'crypto'; + +@ApiTags('Books') +@Controller('/books') +export class BooksController { + public constructor(private readonly booksService: BooksService) { } + + @ApiOperation({ + summary: 'Search for books', + description: 'Search for books', + }) + /** Search for books + * + * @returns The books + */ + @Get('/') + public search(): Promise> { + return this.booksService.search(); + } + + @ApiOperation({ + summary: 'Get a book by its id', + description: 'Get a book by its id', + }) + /** Get a book by its id + * + * @param id - The id of the book + * @returns The book + * */ + @Get('/:id') + public get(@Param() bookRequest: BookRequest): Promise { + return this.booksService.getById(bookRequest.id); + } + + // @ApiOperation({ + // summary: 'Create a book', + // description: 'Create a book', + // }) + // /** Create a book + // * + // * @param create - The book to create + // * @returns The created book + // */ + // @Post('/') + // public create(@Body() create: Prisma.BookCreateInput): Promise { + // return this.booksService.create(create); + // } +} diff --git a/src/Dto/Bibles/Books/BookRequest.ts b/src/Dto/Bibles/Books/BookRequest.ts new file mode 100644 index 0000000..d5ac1c8 --- /dev/null +++ b/src/Dto/Bibles/Books/BookRequest.ts @@ -0,0 +1,17 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { randomUUID } from "crypto"; +import { IsUUID } from 'class-validator'; + +export class BookRequest { + + /** The id of the book to be retrieved. */ + @ApiProperty( + { + description: 'The id of the book to be retrieved.', + example: randomUUID(), + }, + ) + @IsUUID() + public id: string; + +} diff --git a/src/Search/QA/QAService.ts b/src/Search/QA/QAService.ts index 3bfe1be..2153987 100644 --- a/src/Search/QA/QAService.ts +++ b/src/Search/QA/QAService.ts @@ -9,6 +9,7 @@ import { PrismaService } from '../../Data/PrismaService'; @Injectable() export class QAService { + private readonly openai = new OpenAIApi( new Configuration({ apiKey: process.env.OPENAI_API_KEY @@ -30,7 +31,6 @@ export class QAService { return this._qaResult({ id: id }); } - public getByPrompt(prompt: string): Promise { return this.prismaService.qAResult.findFirstOrThrow({ @@ -38,7 +38,6 @@ export class QAService { prompt: prompt, } }) - } public async qa(request: QARequest, nocache: boolean): Promise { @@ -48,7 +47,26 @@ export class QAService { let result: QAResult; let response: CreateCompletionResponse; - const prompt = `${request.prompt} (${getPromptFromBook(['matthew', 'genesis', 'Deuteronomy'])})`; + const defaultBooks = "matthew genesis Deuteronomy".split(' '); + + let booksIds = []; + let books = []; + + if (request.books && request.books.length > 0) { + booksIds = request.books; + booksIds.forEach(async (book: string) => { + const bookObj = await this.booksService.getById(book); + books.push(bookObj.name); + }); + } else { + books = defaultBooks; + defaultBooks.forEach(async (book: string) => { + const bookObj = await this.booksService.getByName(book); + booksIds.push(bookObj.id); + }); + } + + const prompt = `${request.prompt} (${getPromptFromBook(books)})`; console.log(nocache); try { @@ -78,9 +96,8 @@ export class QAService { } if (response) { - const books = ['4072ab14-d440-485b-b58b-ac295d0ca3ca', 'bd71faa2-b209-473f-a86f-4b1ab8c15a12', 'dc20fe41-9989-44a7-a764-a683fc289fd9']; - const qaResultToBook = books.map((book: string) => { - return { 'bookId': book }; + const qaResultToBook = booksIds.map((bookId: string) => { + return { 'bookId': bookId }; }); try { result = await this.prismaService.qAResult.create({ @@ -91,11 +108,6 @@ export class QAService { status: QAResultStatus.ACTIVE, time: Date.now() - start, QAResultToBook: { - // create: [ - // { bookId: '1' }, - // { bookId: '2' }, - // { bookId: '3' } - // ] create: qaResultToBook }, hash: 'hash', diff --git a/src/Server/Server.ts b/src/Server/Server.ts index 757cafb..e264f27 100644 --- a/src/Server/Server.ts +++ b/src/Server/Server.ts @@ -14,7 +14,8 @@ export class Server { const prismaService = app.get(PrismaService); - await prismaService.subscribeToEventBasedLogging(); + // Uncomment this to enable event-based logging + // await prismaService.subscribeToEventBasedLogging(); await prismaService.enableShutdownHooks(app); From 32fa2ea4490a8b8ed3ac4e1d5ce0ff4a6e0cb580 Mon Sep 17 00:00:00 2001 From: Atmo Suwiryo Date: Sun, 28 May 2023 01:14:54 +0700 Subject: [PATCH 4/5] cleanup --- src/Bibles/BiblesController.ts | 1 - src/Bibles/BiblesService.ts | 1 - src/Bibles/Books/BooksController.ts | 1 - src/Data/BookData.ts | 51 +++-------------------------- src/Search/QA/QAService.ts | 17 +++++----- 5 files changed, 14 insertions(+), 57 deletions(-) diff --git a/src/Bibles/BiblesController.ts b/src/Bibles/BiblesController.ts index ca64a3e..e4f73d0 100644 --- a/src/Bibles/BiblesController.ts +++ b/src/Bibles/BiblesController.ts @@ -1,7 +1,6 @@ import { Body, Controller, Get, Param, ParseUUIDPipe, Post } from '@nestjs/common'; import { Prisma, Bible } from '@prisma/client'; import { ApiTags } from '@nestjs/swagger'; -// import { Observable } from 'rxjs'; import { BiblesService } from './BiblesService'; @ApiTags('Bibles') diff --git a/src/Bibles/BiblesService.ts b/src/Bibles/BiblesService.ts index a61c31a..d75613e 100644 --- a/src/Bibles/BiblesService.ts +++ b/src/Bibles/BiblesService.ts @@ -1,7 +1,6 @@ import { Injectable } from '@nestjs/common'; import { Prisma, Bible } from '@prisma/client'; import { PrismaService } from '../Data/PrismaService'; -// import { from, Observable } from 'rxjs'; @Injectable() export class BiblesService { diff --git a/src/Bibles/Books/BooksController.ts b/src/Bibles/Books/BooksController.ts index 33a0c5b..6a67206 100644 --- a/src/Bibles/Books/BooksController.ts +++ b/src/Bibles/Books/BooksController.ts @@ -3,7 +3,6 @@ import { Prisma, Book } from '@prisma/client'; import { ApiTags, ApiOperation, ApiOkResponse } from '@nestjs/swagger'; import { BooksService } from './BooksService'; import { BookRequest } from '../../Dto/Bibles/Books/BookRequest'; -// import { UUID } from 'crypto'; @ApiTags('Books') @Controller('/books') diff --git a/src/Data/BookData.ts b/src/Data/BookData.ts index d1ff909..909df86 100644 --- a/src/Data/BookData.ts +++ b/src/Data/BookData.ts @@ -1,57 +1,16 @@ -export interface Book { - id: number; - title: string; -} -export const books = [ - { - id: 1, - title: 'Genesis' - }, - { - title: 'Matthew', - id: 2 - }, - { - id: 2, - title: 'Exodus' - }, - { - id: 3, - title: 'Leviticus' - }, - { - id: 4, - title: 'Numbers' - }, - { - id: 5, - title: 'Deuteronomy' - }, - { - id: 6, - title: 'Joshua' - }, - { - id: 7, - title: 'Judges' - }, - { - id: 8, - title: 'Ruth' - } -]; +import { Book } from '@prisma/client'; -export const getPromptFromBook = (title: string | string[]) => { +export const getPromptFromBook = (title: string | string[], allBooks: Book[]) => { let selected: Book[]; if (Array.isArray(title)) { - selected = title.map(title => books.find(book => book.title.toLowerCase() === title.toLowerCase())); + selected = title.map(title => allBooks.find(book => book.name.toLowerCase() === title.toLowerCase())); } else { - selected = [books.find(book => book.title.toLowerCase() === title.toLowerCase())]; + selected = [allBooks.find(book => book.name.toLowerCase() === title.toLowerCase())]; } if (selected) { - return `according to the book of ${selected.map(book => book.title).join(' and ')}`; + return `according to the book of ${selected.map(book => book.name).join(' and ')}`; } else { throw new Error(`Book not found: ${title}`); } diff --git a/src/Search/QA/QAService.ts b/src/Search/QA/QAService.ts index 2153987..b50f411 100644 --- a/src/Search/QA/QAService.ts +++ b/src/Search/QA/QAService.ts @@ -48,25 +48,26 @@ export class QAService { let response: CreateCompletionResponse; const defaultBooks = "matthew genesis Deuteronomy".split(' '); + const allBooks = await this.booksService.search(); let booksIds = []; - let books = []; + let selectedBooks = []; if (request.books && request.books.length > 0) { booksIds = request.books; - booksIds.forEach(async (book: string) => { - const bookObj = await this.booksService.getById(book); - books.push(bookObj.name); + booksIds.forEach(async (bookId: string) => { + const bookObj = await this.booksService.getById(bookId); + selectedBooks.push(bookObj.name); }); } else { - books = defaultBooks; - defaultBooks.forEach(async (book: string) => { - const bookObj = await this.booksService.getByName(book); + selectedBooks = defaultBooks; + defaultBooks.forEach(async (bookName: string) => { + const bookObj = await this.booksService.getByName(bookName); booksIds.push(bookObj.id); }); } - const prompt = `${request.prompt} (${getPromptFromBook(books)})`; + const prompt = `${request.prompt} (${getPromptFromBook(selectedBooks, allBooks)})`; console.log(nocache); try { From e44d5bffdb88bf0e6d22f37c680f097eb1e2ff14 Mon Sep 17 00:00:00 2001 From: Atmo Suwiryo Date: Sun, 28 May 2023 01:26:35 +0700 Subject: [PATCH 5/5] fix hash prompt --- package-lock.json | 674 +++++++++++++++++++++++++++++++++---- package.json | 3 +- src/Search/QA/QAService.ts | 4 +- 3 files changed, 615 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddff6b8..7aaa18a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@prisma/client": "^4.12.0", "amqplib": "^0.10.2", "aws-sdk": "^2.1214.0", + "bcrypt": "^5.1.0", "class-transformer": "^0.5.1", "class-validator": "^0.13.2", "compression": "^1.7.4", @@ -1085,6 +1086,53 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@nestjs.pro/amqp": { "version": "0.0.38", "resolved": "https://registry.npmjs.org/@nestjs.pro/amqp/-/amqp-0.0.38.tgz", @@ -1843,8 +1891,7 @@ "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "node_modules/accepts": { "version": "1.3.8", @@ -1858,6 +1905,38 @@ "node": ">= 0.6" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/amqplib": { "version": "0.10.2", "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.2.tgz", @@ -1891,7 +1970,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -1928,6 +2006,44 @@ "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2135,8 +2251,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-js": { "version": "1.5.1", @@ -2173,6 +2288,19 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/bcrypt": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.0.tgz", + "integrity": "sha512-RHBS7HI5N5tEnGTmtR/pppX0mmDSBpQ4aCBsj7CEQfYXDcO74A8sIBYcJMuCsis2E81zDxeENYhv66oZwLiA+Q==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.10", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -2227,7 +2355,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2420,6 +2547,14 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, "node_modules/ci-info": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", @@ -2489,6 +2624,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2550,8 +2693,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -2669,6 +2811,11 @@ "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==" }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -2823,6 +2970,11 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -2840,6 +2992,14 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -2902,8 +3062,7 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -3281,11 +3440,32 @@ "node": ">= 0.6" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/fsevents": { "version": "2.3.2", @@ -3331,6 +3511,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3402,7 +3601,6 @@ "version": "7.2.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3508,6 +3706,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "node_modules/hexoid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", @@ -3543,6 +3746,39 @@ "node": ">= 0.8" } }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -3601,7 +3837,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3742,7 +3977,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -4740,7 +4974,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4752,7 +4985,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, "dependencies": { "semver": "^6.0.0" }, @@ -4861,7 +5093,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4874,6 +5105,48 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -4975,6 +5248,11 @@ "node": ">= 0.6" } }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -5135,6 +5413,17 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5207,7 +5496,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "dependencies": { "wrappy": "1" } @@ -5334,7 +5622,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5670,7 +5957,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -5722,7 +6008,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -5769,6 +6054,11 @@ "node": ">= 0.8.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -5817,8 +6107,7 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/simple-update-notifier": { "version": "1.0.7", @@ -5945,7 +6234,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5985,7 +6273,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6186,6 +6473,22 @@ "express": ">=4.0.0" } }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -6609,6 +6912,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -6629,8 +6940,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/write-file-atomic": { "version": "4.0.1", @@ -6665,8 +6975,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yocto-queue": { "version": "0.1.0", @@ -7488,6 +7797,40 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "@nestjs.pro/amqp": { "version": "0.0.38", "resolved": "https://registry.npmjs.org/@nestjs.pro/amqp/-/amqp-0.0.38.tgz", @@ -8054,8 +8397,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "accepts": { "version": "1.3.8", @@ -8066,6 +8408,29 @@ "negotiator": "0.6.3" } }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "amqplib": { "version": "0.10.2", "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.2.tgz", @@ -8089,8 +8454,7 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -8115,6 +8479,40 @@ "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -8288,8 +8686,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-js": { "version": "1.5.1", @@ -8311,6 +8708,15 @@ } } }, + "bcrypt": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.0.tgz", + "integrity": "sha512-RHBS7HI5N5tEnGTmtR/pppX0mmDSBpQ4aCBsj7CEQfYXDcO74A8sIBYcJMuCsis2E81zDxeENYhv66oZwLiA+Q==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.10", + "node-addon-api": "^5.0.0" + } + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -8357,7 +8763,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8483,6 +8888,11 @@ "readdirp": "~3.6.0" } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, "ci-info": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", @@ -8545,6 +8955,11 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -8596,8 +9011,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -8698,6 +9112,11 @@ "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==" }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -8817,6 +9236,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -8827,6 +9251,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -8874,8 +9303,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "encodeurl": { "version": "1.0.2", @@ -9164,11 +9592,28 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -9198,6 +9643,22 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -9245,7 +9706,6 @@ "version": "7.2.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -9315,6 +9775,11 @@ "has-symbols": "^1.0.2" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "hexoid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", @@ -9344,6 +9809,30 @@ "toidentifier": "1.0.1" } }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -9384,7 +9873,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -9482,8 +9970,7 @@ "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-generator-fn": { "version": "2.1.0", @@ -10227,7 +10714,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -10236,7 +10722,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, "requires": { "semver": "^6.0.0" } @@ -10315,7 +10800,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -10325,6 +10809,35 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -10415,6 +10928,11 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, "node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -10536,6 +11054,17 @@ "path-key": "^3.0.0" } }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -10584,7 +11113,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -10678,8 +11206,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", @@ -10924,7 +11451,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -10955,8 +11481,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "send": { "version": "0.18.0", @@ -10996,6 +11521,11 @@ "send": "0.18.0" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -11035,8 +11565,7 @@ "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "simple-update-notifier": { "version": "1.0.7", @@ -11138,7 +11667,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -11169,7 +11697,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -11310,6 +11837,19 @@ "swagger-ui-dist": ">=4.11.0" } }, + "tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -11603,6 +12143,14 @@ "is-typed-array": "^1.1.9" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -11617,8 +12165,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "4.0.1", @@ -11644,8 +12191,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yocto-queue": { "version": "0.1.0", diff --git a/package.json b/package.json index 3cfcb54..93002b8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "private": true, "prisma": { - "seed": "ts-node prisma/seed.ts" + "seed": "ts-node prisma/seed.ts" }, "scripts": { "build": "tsc", @@ -23,6 +23,7 @@ "@prisma/client": "^4.12.0", "amqplib": "^0.10.2", "aws-sdk": "^2.1214.0", + "bcrypt": "^5.1.0", "class-transformer": "^0.5.1", "class-validator": "^0.13.2", "compression": "^1.7.4", diff --git a/src/Search/QA/QAService.ts b/src/Search/QA/QAService.ts index b50f411..f8f0a12 100644 --- a/src/Search/QA/QAService.ts +++ b/src/Search/QA/QAService.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; +import { hash } from 'bcrypt'; import { Configuration, CreateCompletionResponse, OpenAIApi } from 'openai'; import { BooksService } from '../../Bibles/Books/BooksService'; import { getPromptFromBook } from '../../Data/BookData'; @@ -73,6 +74,7 @@ export class QAService { try { if (!nocache) { console.log(prompt); + // TODO: Use hash instead of prompt result = await this.getByPrompt(prompt); console.log('cache hit', result); return { ...result, hit: QAHitType.CACHE }; @@ -111,7 +113,7 @@ export class QAService { QAResultToBook: { create: qaResultToBook }, - hash: 'hash', + hash: await hash(prompt, 10), hit: QAHitType.LIVE }