diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/src/modules/article/README.md b/apps/article/README.md similarity index 100% rename from src/modules/article/README.md rename to apps/article/README.md diff --git a/src/modules/article/application/commands/command.module.ts b/apps/article/src/application/commands/command.module.ts similarity index 100% rename from src/modules/article/application/commands/command.module.ts rename to apps/article/src/application/commands/command.module.ts diff --git a/src/modules/article/application/commands/handlers/create-article.handler.ts b/apps/article/src/application/commands/handlers/create-article.handler.ts similarity index 90% rename from src/modules/article/application/commands/handlers/create-article.handler.ts rename to apps/article/src/application/commands/handlers/create-article.handler.ts index 3caa2d6..8b79e58 100644 --- a/src/modules/article/application/commands/handlers/create-article.handler.ts +++ b/apps/article/src/application/commands/handlers/create-article.handler.ts @@ -16,8 +16,10 @@ export class CreateArticleCommandHandler implements ICommandHandler { private readonly sqs: AWS.SQS; - private readonly awsRegion: string = process.env.AWS_REGION; - private readonly queueUrl: string = process.env.AWS_SQS_QUEUE_URL; + private readonly awsRegion: string = + process.env.AWS_REGION || "ap-southeast-1"; + private readonly queueUrl: string = + process.env.AWS_SQS_QUEUE_URL || "ARTICLE_QUEUE_URL"; constructor( @Inject(ARTICLE_REPOSITORY) diff --git a/src/modules/article/application/commands/handlers/create-comment.handler.ts b/apps/article/src/application/commands/handlers/create-comment.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/create-comment.handler.ts rename to apps/article/src/application/commands/handlers/create-comment.handler.ts diff --git a/src/modules/article/application/commands/handlers/delete-article.handler.ts b/apps/article/src/application/commands/handlers/delete-article.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/delete-article.handler.ts rename to apps/article/src/application/commands/handlers/delete-article.handler.ts diff --git a/src/modules/article/application/commands/handlers/delete-comment.handler.ts b/apps/article/src/application/commands/handlers/delete-comment.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/delete-comment.handler.ts rename to apps/article/src/application/commands/handlers/delete-comment.handler.ts diff --git a/src/modules/article/application/commands/handlers/favorite-article.handler.ts b/apps/article/src/application/commands/handlers/favorite-article.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/favorite-article.handler.ts rename to apps/article/src/application/commands/handlers/favorite-article.handler.ts diff --git a/src/modules/article/application/commands/handlers/index.ts b/apps/article/src/application/commands/handlers/index.ts similarity index 100% rename from src/modules/article/application/commands/handlers/index.ts rename to apps/article/src/application/commands/handlers/index.ts diff --git a/src/modules/article/application/commands/handlers/seed-article.handler.ts b/apps/article/src/application/commands/handlers/seed-article.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/seed-article.handler.ts rename to apps/article/src/application/commands/handlers/seed-article.handler.ts diff --git a/src/modules/article/application/commands/handlers/unfavorite-article.handler.ts b/apps/article/src/application/commands/handlers/unfavorite-article.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/unfavorite-article.handler.ts rename to apps/article/src/application/commands/handlers/unfavorite-article.handler.ts diff --git a/src/modules/article/application/commands/handlers/update-article.handler.ts b/apps/article/src/application/commands/handlers/update-article.handler.ts similarity index 100% rename from src/modules/article/application/commands/handlers/update-article.handler.ts rename to apps/article/src/application/commands/handlers/update-article.handler.ts diff --git a/src/modules/article/application/commands/impl/create-article.command.ts b/apps/article/src/application/commands/impl/create-article.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/create-article.command.ts rename to apps/article/src/application/commands/impl/create-article.command.ts diff --git a/src/modules/article/application/commands/impl/create-comment.command.ts b/apps/article/src/application/commands/impl/create-comment.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/create-comment.command.ts rename to apps/article/src/application/commands/impl/create-comment.command.ts diff --git a/src/modules/article/application/commands/impl/delete-article.command.ts b/apps/article/src/application/commands/impl/delete-article.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/delete-article.command.ts rename to apps/article/src/application/commands/impl/delete-article.command.ts diff --git a/src/modules/article/application/commands/impl/delete-comment.command.ts b/apps/article/src/application/commands/impl/delete-comment.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/delete-comment.command.ts rename to apps/article/src/application/commands/impl/delete-comment.command.ts diff --git a/src/modules/article/application/commands/impl/favorite-article.command.ts b/apps/article/src/application/commands/impl/favorite-article.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/favorite-article.command.ts rename to apps/article/src/application/commands/impl/favorite-article.command.ts diff --git a/src/modules/article/application/commands/impl/index.ts b/apps/article/src/application/commands/impl/index.ts similarity index 100% rename from src/modules/article/application/commands/impl/index.ts rename to apps/article/src/application/commands/impl/index.ts diff --git a/src/modules/article/application/commands/impl/unfavorite-article.command.ts b/apps/article/src/application/commands/impl/unfavorite-article.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/unfavorite-article.command.ts rename to apps/article/src/application/commands/impl/unfavorite-article.command.ts diff --git a/src/modules/article/application/commands/impl/update-article.command.ts b/apps/article/src/application/commands/impl/update-article.command.ts similarity index 100% rename from src/modules/article/application/commands/impl/update-article.command.ts rename to apps/article/src/application/commands/impl/update-article.command.ts diff --git a/src/modules/article/application/commands/index.ts b/apps/article/src/application/commands/index.ts similarity index 100% rename from src/modules/article/application/commands/index.ts rename to apps/article/src/application/commands/index.ts diff --git a/src/modules/article/application/jobs/article-jobs.service.ts b/apps/article/src/application/jobs/article-jobs.service.ts similarity index 100% rename from src/modules/article/application/jobs/article-jobs.service.ts rename to apps/article/src/application/jobs/article-jobs.service.ts diff --git a/src/modules/article/application/jobs/index.ts b/apps/article/src/application/jobs/index.ts similarity index 100% rename from src/modules/article/application/jobs/index.ts rename to apps/article/src/application/jobs/index.ts diff --git a/src/modules/article/application/queries/handlers/find-all.article.handler.ts b/apps/article/src/application/queries/handlers/find-all.article.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/find-all.article.handler.ts rename to apps/article/src/application/queries/handlers/find-all.article.handler.ts diff --git a/src/modules/article/application/queries/handlers/find-comments.handler.ts b/apps/article/src/application/queries/handlers/find-comments.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/find-comments.handler.ts rename to apps/article/src/application/queries/handlers/find-comments.handler.ts diff --git a/src/modules/article/application/queries/handlers/find-feed-article.handler.ts b/apps/article/src/application/queries/handlers/find-feed-article.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/find-feed-article.handler.ts rename to apps/article/src/application/queries/handlers/find-feed-article.handler.ts diff --git a/src/modules/article/application/queries/handlers/find-one-article.handler.ts b/apps/article/src/application/queries/handlers/find-one-article.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/find-one-article.handler.ts rename to apps/article/src/application/queries/handlers/find-one-article.handler.ts diff --git a/src/modules/article/application/queries/handlers/get-hot-article-monthly.handler.ts b/apps/article/src/application/queries/handlers/get-hot-article-monthly.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/get-hot-article-monthly.handler.ts rename to apps/article/src/application/queries/handlers/get-hot-article-monthly.handler.ts diff --git a/src/modules/article/application/queries/handlers/get-hot.article.handler.ts b/apps/article/src/application/queries/handlers/get-hot.article.handler.ts similarity index 100% rename from src/modules/article/application/queries/handlers/get-hot.article.handler.ts rename to apps/article/src/application/queries/handlers/get-hot.article.handler.ts diff --git a/src/modules/article/application/queries/handlers/index.ts b/apps/article/src/application/queries/handlers/index.ts similarity index 100% rename from src/modules/article/application/queries/handlers/index.ts rename to apps/article/src/application/queries/handlers/index.ts diff --git a/src/modules/article/application/queries/impl/find-all.article.query.ts b/apps/article/src/application/queries/impl/find-all.article.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/find-all.article.query.ts rename to apps/article/src/application/queries/impl/find-all.article.query.ts diff --git a/src/modules/article/application/queries/impl/find-comments.query.ts b/apps/article/src/application/queries/impl/find-comments.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/find-comments.query.ts rename to apps/article/src/application/queries/impl/find-comments.query.ts diff --git a/src/modules/article/application/queries/impl/find-feed-article.query.ts b/apps/article/src/application/queries/impl/find-feed-article.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/find-feed-article.query.ts rename to apps/article/src/application/queries/impl/find-feed-article.query.ts diff --git a/src/modules/article/application/queries/impl/find-one-article.query.ts b/apps/article/src/application/queries/impl/find-one-article.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/find-one-article.query.ts rename to apps/article/src/application/queries/impl/find-one-article.query.ts diff --git a/src/modules/article/application/queries/impl/get-hot-article-monthly.query.ts b/apps/article/src/application/queries/impl/get-hot-article-monthly.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/get-hot-article-monthly.query.ts rename to apps/article/src/application/queries/impl/get-hot-article-monthly.query.ts diff --git a/src/modules/article/application/queries/impl/get-hot.article.query.ts b/apps/article/src/application/queries/impl/get-hot.article.query.ts similarity index 100% rename from src/modules/article/application/queries/impl/get-hot.article.query.ts rename to apps/article/src/application/queries/impl/get-hot.article.query.ts diff --git a/src/modules/article/application/queries/impl/index.ts b/apps/article/src/application/queries/impl/index.ts similarity index 100% rename from src/modules/article/application/queries/impl/index.ts rename to apps/article/src/application/queries/impl/index.ts diff --git a/src/modules/article/application/queries/index.ts b/apps/article/src/application/queries/index.ts similarity index 100% rename from src/modules/article/application/queries/index.ts rename to apps/article/src/application/queries/index.ts diff --git a/src/modules/article/application/queries/query.module.ts b/apps/article/src/application/queries/query.module.ts similarity index 100% rename from src/modules/article/application/queries/query.module.ts rename to apps/article/src/application/queries/query.module.ts diff --git a/src/modules/article/application/services/article.service.ts b/apps/article/src/application/services/article.service.ts similarity index 100% rename from src/modules/article/application/services/article.service.ts rename to apps/article/src/application/services/article.service.ts diff --git a/src/modules/article/application/services/index.ts b/apps/article/src/application/services/index.ts similarity index 53% rename from src/modules/article/application/services/index.ts rename to apps/article/src/application/services/index.ts index 258dc29..e5a7466 100644 --- a/src/modules/article/application/services/index.ts +++ b/apps/article/src/application/services/index.ts @@ -1 +1,2 @@ export * from "./article.service"; +export * from "./tag.service"; diff --git a/src/modules/tag/application/tag.service.ts b/apps/article/src/application/services/tag.service.ts similarity index 100% rename from src/modules/tag/application/tag.service.ts rename to apps/article/src/application/services/tag.service.ts diff --git a/src/modules/article/article.module.ts b/apps/article/src/article.module.ts similarity index 100% rename from src/modules/article/article.module.ts rename to apps/article/src/article.module.ts diff --git a/src/modules/article/core/constants/index.ts b/apps/article/src/core/constants/index.ts similarity index 100% rename from src/modules/article/core/constants/index.ts rename to apps/article/src/core/constants/index.ts diff --git a/src/modules/article/core/dto/article-query.ts b/apps/article/src/core/dto/article-query.ts similarity index 100% rename from src/modules/article/core/dto/article-query.ts rename to apps/article/src/core/dto/article-query.ts diff --git a/src/modules/article/core/dto/block.dto.ts b/apps/article/src/core/dto/block.dto.ts similarity index 100% rename from src/modules/article/core/dto/block.dto.ts rename to apps/article/src/core/dto/block.dto.ts diff --git a/src/modules/article/core/dto/create-article.dto.ts b/apps/article/src/core/dto/create-article.dto.ts similarity index 100% rename from src/modules/article/core/dto/create-article.dto.ts rename to apps/article/src/core/dto/create-article.dto.ts diff --git a/src/modules/article/core/dto/create-comment.ts b/apps/article/src/core/dto/create-comment.ts similarity index 100% rename from src/modules/article/core/dto/create-comment.ts rename to apps/article/src/core/dto/create-comment.ts diff --git a/src/modules/article/core/dto/index.ts b/apps/article/src/core/dto/index.ts similarity index 100% rename from src/modules/article/core/dto/index.ts rename to apps/article/src/core/dto/index.ts diff --git a/src/modules/article/core/entities/article.entity.ts b/apps/article/src/core/entities/article.entity.ts similarity index 89% rename from src/modules/article/core/entities/article.entity.ts rename to apps/article/src/core/entities/article.entity.ts index 126ab34..bbc2b76 100644 --- a/src/modules/article/core/entities/article.entity.ts +++ b/apps/article/src/core/entities/article.entity.ts @@ -4,12 +4,9 @@ import { Entity, Index, JoinColumn, - ManyToOne, OneToMany, PrimaryGeneratedColumn, } from "typeorm"; - -import { UserEntity } from "@user/core/entities/user.entity"; import { IArticle } from "../interfaces/article.interface"; import { BlockEntity } from "./block.entity"; import { CommentEntity } from "./comment.entity"; @@ -50,8 +47,8 @@ export class ArticleEntity { @Column("simple-array") tagList: string[]; - @ManyToOne((type) => UserEntity, (user) => user.articles) - author: UserEntity; + @Column({ name: "authorId" }) + authorId: number; @OneToMany((type) => CommentEntity, (comment) => comment.article, { eager: true, diff --git a/src/modules/article/core/entities/block.entity.ts b/apps/article/src/core/entities/block.entity.ts similarity index 100% rename from src/modules/article/core/entities/block.entity.ts rename to apps/article/src/core/entities/block.entity.ts diff --git a/src/modules/article/core/entities/comment.entity.ts b/apps/article/src/core/entities/comment.entity.ts similarity index 84% rename from src/modules/article/core/entities/comment.entity.ts rename to apps/article/src/core/entities/comment.entity.ts index 11d905e..dc52d3f 100644 --- a/src/modules/article/core/entities/comment.entity.ts +++ b/apps/article/src/core/entities/comment.entity.ts @@ -1,13 +1,12 @@ import { - Entity, - PrimaryGeneratedColumn, + BeforeUpdate, Column, + Entity, ManyToOne, - BeforeUpdate, + PrimaryGeneratedColumn, } from "typeorm"; -import { UserEntity } from "@user/core/entities/user.entity"; -import { ArticleEntity } from "./article.entity"; import { IComment } from "../interfaces/article.interface"; +import { ArticleEntity } from "./article.entity"; @Entity("comment") export class CommentEntity { @@ -35,6 +34,6 @@ export class CommentEntity { @ManyToOne((type) => ArticleEntity, (article) => article.comments) article: ArticleEntity; - @ManyToOne(() => UserEntity, (user) => user.comments) - author: UserEntity; + @Column({ name: "authorId" }) + authorId: number; } diff --git a/src/modules/article/core/entities/index.ts b/apps/article/src/core/entities/index.ts similarity index 76% rename from src/modules/article/core/entities/index.ts rename to apps/article/src/core/entities/index.ts index 0d15db0..35af197 100644 --- a/src/modules/article/core/entities/index.ts +++ b/apps/article/src/core/entities/index.ts @@ -1,3 +1,4 @@ export * from "./article.entity"; export * from "./block.entity"; export * from "./comment.entity"; +export * from "./tag.entity"; diff --git a/src/modules/tag/core/entities/tag.entity.ts b/apps/article/src/core/entities/tag.entity.ts similarity index 55% rename from src/modules/tag/core/entities/tag.entity.ts rename to apps/article/src/core/entities/tag.entity.ts index a222712..4caeabc 100644 --- a/src/modules/tag/core/entities/tag.entity.ts +++ b/apps/article/src/core/entities/tag.entity.ts @@ -1,12 +1,10 @@ -import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; +import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; -@Entity('tag') +@Entity("tag") export class TagEntity { - @PrimaryGeneratedColumn() id: number; @Column() tag: string; - } diff --git a/src/modules/article/core/enums/article.enum.ts b/apps/article/src/core/enums/article.enum.ts similarity index 100% rename from src/modules/article/core/enums/article.enum.ts rename to apps/article/src/core/enums/article.enum.ts diff --git a/src/modules/article/core/enums/block.enum.ts b/apps/article/src/core/enums/block.enum.ts similarity index 100% rename from src/modules/article/core/enums/block.enum.ts rename to apps/article/src/core/enums/block.enum.ts diff --git a/src/modules/article/core/enums/index.ts b/apps/article/src/core/enums/index.ts similarity index 100% rename from src/modules/article/core/enums/index.ts rename to apps/article/src/core/enums/index.ts diff --git a/src/modules/article/core/index.ts b/apps/article/src/core/index.ts similarity index 100% rename from src/modules/article/core/index.ts rename to apps/article/src/core/index.ts diff --git a/src/modules/article/core/interfaces/article.interface.ts b/apps/article/src/core/interfaces/article.interface.ts similarity index 100% rename from src/modules/article/core/interfaces/article.interface.ts rename to apps/article/src/core/interfaces/article.interface.ts diff --git a/src/modules/article/core/interfaces/block.interface.ts b/apps/article/src/core/interfaces/block.interface.ts similarity index 100% rename from src/modules/article/core/interfaces/block.interface.ts rename to apps/article/src/core/interfaces/block.interface.ts diff --git a/src/modules/article/core/interfaces/index.ts b/apps/article/src/core/interfaces/index.ts similarity index 68% rename from src/modules/article/core/interfaces/index.ts rename to apps/article/src/core/interfaces/index.ts index 9a5f693..75c8de4 100644 --- a/src/modules/article/core/interfaces/index.ts +++ b/apps/article/src/core/interfaces/index.ts @@ -1,2 +1,3 @@ export * from "./article.interface"; export * from "./block.interface"; +export * from "./tag.interface"; diff --git a/src/modules/tag/core/interfaces/tag.interface.ts b/apps/article/src/core/interfaces/tag.interface.ts similarity index 100% rename from src/modules/tag/core/interfaces/tag.interface.ts rename to apps/article/src/core/interfaces/tag.interface.ts diff --git a/src/modules/article/core/ports/article.port.ts b/apps/article/src/core/ports/article.port.ts similarity index 84% rename from src/modules/article/core/ports/article.port.ts rename to apps/article/src/core/ports/article.port.ts index 539f43c..d1918c1 100644 --- a/src/modules/article/core/ports/article.port.ts +++ b/apps/article/src/core/ports/article.port.ts @@ -1,8 +1,6 @@ -// src/application/port/article.port.ts import { DeepPartial, DeleteResult, - FindConditions, FindManyOptions, FindOneOptions, QueryRunner, @@ -19,7 +17,6 @@ export interface ArticlePort { ): SelectQueryBuilder; find(options?: FindManyOptions): Promise; - find(conditions?: FindConditions): Promise; findOne( id?: string | number, @@ -29,7 +26,7 @@ export interface ArticlePort { options?: FindOneOptions ): Promise; findOne( - conditions?: FindConditions, + conditions?: FindOneOptions, options?: FindOneOptions ): Promise; @@ -49,6 +46,6 @@ export interface ArticlePort { | string[] | number | number[] - | FindConditions + | FindOneOptions ): Promise; } diff --git a/src/modules/article/core/ports/block.port.ts b/apps/article/src/core/ports/block.port.ts similarity index 100% rename from src/modules/article/core/ports/block.port.ts rename to apps/article/src/core/ports/block.port.ts diff --git a/src/modules/article/core/ports/comment.port.ts b/apps/article/src/core/ports/comment.port.ts similarity index 100% rename from src/modules/article/core/ports/comment.port.ts rename to apps/article/src/core/ports/comment.port.ts diff --git a/src/modules/article/core/ports/index.ts b/apps/article/src/core/ports/index.ts similarity index 77% rename from src/modules/article/core/ports/index.ts rename to apps/article/src/core/ports/index.ts index 91581bf..c68bea2 100644 --- a/src/modules/article/core/ports/index.ts +++ b/apps/article/src/core/ports/index.ts @@ -1,3 +1,4 @@ export * from "./article.port"; -export * from "./comment.port"; export * from "./block.port"; +export * from "./comment.port"; +export * from "./tag.port"; diff --git a/src/modules/tag/core/ports/tag.port.ts b/apps/article/src/core/ports/tag.port.ts similarity index 52% rename from src/modules/tag/core/ports/tag.port.ts rename to apps/article/src/core/ports/tag.port.ts index eb35216..9320d7b 100644 --- a/src/modules/tag/core/ports/tag.port.ts +++ b/apps/article/src/core/ports/tag.port.ts @@ -1,8 +1,7 @@ -import { FindConditions, FindManyOptions } from "typeorm"; +import { FindManyOptions } from "typeorm"; import { TagEntity } from "../entities"; export interface TagPort { find(options?: FindManyOptions): Promise; - find(conditions?: FindConditions): Promise; } diff --git a/src/modules/article/core/token/index.ts b/apps/article/src/core/token/index.ts similarity index 77% rename from src/modules/article/core/token/index.ts rename to apps/article/src/core/token/index.ts index 31cb1f3..79c0790 100644 --- a/src/modules/article/core/token/index.ts +++ b/apps/article/src/core/token/index.ts @@ -3,3 +3,5 @@ export const ARTICLE_REPOSITORY = "ARTICLE_REPOSITORY"; export const BLOCK_REPOSITORY = "BLOCK_REPOSITORY"; export const COMMENT_REPOSITORY = "COMMENT_REPOSITORY"; + +export const TAG_REPOSITORY = "TAG_REPOSITORY"; diff --git a/apps/article/src/main.ts b/apps/article/src/main.ts new file mode 100644 index 0000000..261e255 --- /dev/null +++ b/apps/article/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { ArticleModule } from './article.module'; + +async function bootstrap() { + const app = await NestFactory.create(ArticleModule); + await app.listen(3000); +} +bootstrap(); diff --git a/src/modules/article/presentation/index.ts b/apps/article/src/presentation/index.ts similarity index 100% rename from src/modules/article/presentation/index.ts rename to apps/article/src/presentation/index.ts diff --git a/src/modules/article/presentation/rest/article.controller.ts b/apps/article/src/presentation/rest/article.controller.ts similarity index 100% rename from src/modules/article/presentation/rest/article.controller.ts rename to apps/article/src/presentation/rest/article.controller.ts diff --git a/src/modules/article/presentation/rest/index.ts b/apps/article/src/presentation/rest/index.ts similarity index 52% rename from src/modules/article/presentation/rest/index.ts rename to apps/article/src/presentation/rest/index.ts index 9a4045f..3edfc92 100644 --- a/src/modules/article/presentation/rest/index.ts +++ b/apps/article/src/presentation/rest/index.ts @@ -1 +1,2 @@ export * from "./article.controller"; +export * from "./tag.controller"; diff --git a/src/modules/tag/presentation/tag.controller.ts b/apps/article/src/presentation/rest/tag.controller.ts similarity index 100% rename from src/modules/tag/presentation/tag.controller.ts rename to apps/article/src/presentation/rest/tag.controller.ts diff --git a/apps/article/test/app.e2e-spec.ts b/apps/article/test/app.e2e-spec.ts new file mode 100644 index 0000000..17cc980 --- /dev/null +++ b/apps/article/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { ArticleModule } from './../src/article.module'; + +describe('ArticleController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [ArticleModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/apps/article/test/jest-e2e.json b/apps/article/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/article/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/article/tsconfig.app.json b/apps/article/tsconfig.app.json new file mode 100644 index 0000000..b87510e --- /dev/null +++ b/apps/article/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/article" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/src/modules/media/README.md b/apps/media/README.md similarity index 100% rename from src/modules/media/README.md rename to apps/media/README.md diff --git a/src/modules/media/application/index.ts b/apps/media/src/application/index.ts similarity index 100% rename from src/modules/media/application/index.ts rename to apps/media/src/application/index.ts diff --git a/src/modules/media/application/services/dropbox.service.ts b/apps/media/src/application/services/dropbox.service.ts similarity index 100% rename from src/modules/media/application/services/dropbox.service.ts rename to apps/media/src/application/services/dropbox.service.ts diff --git a/src/modules/media/application/services/index.ts b/apps/media/src/application/services/index.ts similarity index 100% rename from src/modules/media/application/services/index.ts rename to apps/media/src/application/services/index.ts diff --git a/src/modules/media/application/services/s3.service.ts b/apps/media/src/application/services/s3.service.ts similarity index 100% rename from src/modules/media/application/services/s3.service.ts rename to apps/media/src/application/services/s3.service.ts diff --git a/src/modules/media/core/entities/file.entity.ts b/apps/media/src/core/entities/file.entity.ts similarity index 100% rename from src/modules/media/core/entities/file.entity.ts rename to apps/media/src/core/entities/file.entity.ts diff --git a/src/modules/media/core/entities/index.ts b/apps/media/src/core/entities/index.ts similarity index 100% rename from src/modules/media/core/entities/index.ts rename to apps/media/src/core/entities/index.ts diff --git a/src/modules/media/core/enums/index.ts b/apps/media/src/core/enums/index.ts similarity index 100% rename from src/modules/media/core/enums/index.ts rename to apps/media/src/core/enums/index.ts diff --git a/src/modules/media/core/enums/message.enum.ts b/apps/media/src/core/enums/message.enum.ts similarity index 100% rename from src/modules/media/core/enums/message.enum.ts rename to apps/media/src/core/enums/message.enum.ts diff --git a/src/modules/media/core/index.ts b/apps/media/src/core/index.ts similarity index 100% rename from src/modules/media/core/index.ts rename to apps/media/src/core/index.ts diff --git a/src/modules/media/core/interfaces/file.interface.ts b/apps/media/src/core/interfaces/file.interface.ts similarity index 100% rename from src/modules/media/core/interfaces/file.interface.ts rename to apps/media/src/core/interfaces/file.interface.ts diff --git a/src/modules/media/core/interfaces/index.ts b/apps/media/src/core/interfaces/index.ts similarity index 100% rename from src/modules/media/core/interfaces/index.ts rename to apps/media/src/core/interfaces/index.ts diff --git a/src/modules/media/core/interfaces/media.interface.ts b/apps/media/src/core/interfaces/media.interface.ts similarity index 100% rename from src/modules/media/core/interfaces/media.interface.ts rename to apps/media/src/core/interfaces/media.interface.ts diff --git a/src/modules/media/core/ports/file.port.ts b/apps/media/src/core/ports/file.port.ts similarity index 100% rename from src/modules/media/core/ports/file.port.ts rename to apps/media/src/core/ports/file.port.ts diff --git a/src/modules/media/core/ports/index.ts b/apps/media/src/core/ports/index.ts similarity index 100% rename from src/modules/media/core/ports/index.ts rename to apps/media/src/core/ports/index.ts diff --git a/src/modules/media/core/token/index.ts b/apps/media/src/core/token/index.ts similarity index 100% rename from src/modules/media/core/token/index.ts rename to apps/media/src/core/token/index.ts diff --git a/apps/media/src/main.ts b/apps/media/src/main.ts new file mode 100644 index 0000000..03d32d0 --- /dev/null +++ b/apps/media/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { MediaModule } from './media.module'; + +async function bootstrap() { + const app = await NestFactory.create(MediaModule); + await app.listen(3000); +} +bootstrap(); diff --git a/src/modules/media/media.module.ts b/apps/media/src/media.module.ts similarity index 100% rename from src/modules/media/media.module.ts rename to apps/media/src/media.module.ts diff --git a/src/modules/media/presentation/index.ts b/apps/media/src/presentation/index.ts similarity index 100% rename from src/modules/media/presentation/index.ts rename to apps/media/src/presentation/index.ts diff --git a/src/modules/media/presentation/rest/index.ts b/apps/media/src/presentation/rest/index.ts similarity index 100% rename from src/modules/media/presentation/rest/index.ts rename to apps/media/src/presentation/rest/index.ts diff --git a/src/modules/media/presentation/rest/media.controller.ts b/apps/media/src/presentation/rest/media.controller.ts similarity index 100% rename from src/modules/media/presentation/rest/media.controller.ts rename to apps/media/src/presentation/rest/media.controller.ts diff --git a/apps/media/test/app.e2e-spec.ts b/apps/media/test/app.e2e-spec.ts new file mode 100644 index 0000000..c044ab6 --- /dev/null +++ b/apps/media/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { MediaModule } from './../src/media.module'; + +describe('MediaController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [MediaModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/apps/media/test/jest-e2e.json b/apps/media/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/media/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/media/tsconfig.app.json b/apps/media/tsconfig.app.json new file mode 100644 index 0000000..3043cc9 --- /dev/null +++ b/apps/media/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/media" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/src/modules/profile/README.md b/apps/profile/src/README.md similarity index 100% rename from src/modules/profile/README.md rename to apps/profile/src/README.md diff --git a/src/modules/profile/application/commands/command.module.ts b/apps/profile/src/application/commands/command.module.ts similarity index 100% rename from src/modules/profile/application/commands/command.module.ts rename to apps/profile/src/application/commands/command.module.ts diff --git a/src/modules/profile/application/commands/handlers/follow-profile.handler.ts b/apps/profile/src/application/commands/handlers/follow-profile.handler.ts similarity index 100% rename from src/modules/profile/application/commands/handlers/follow-profile.handler.ts rename to apps/profile/src/application/commands/handlers/follow-profile.handler.ts diff --git a/src/modules/profile/application/commands/handlers/index.ts b/apps/profile/src/application/commands/handlers/index.ts similarity index 100% rename from src/modules/profile/application/commands/handlers/index.ts rename to apps/profile/src/application/commands/handlers/index.ts diff --git a/src/modules/profile/application/commands/handlers/unfollow-profile.handler.ts b/apps/profile/src/application/commands/handlers/unfollow-profile.handler.ts similarity index 100% rename from src/modules/profile/application/commands/handlers/unfollow-profile.handler.ts rename to apps/profile/src/application/commands/handlers/unfollow-profile.handler.ts diff --git a/src/modules/profile/application/commands/impl/follow-profile.command.ts b/apps/profile/src/application/commands/impl/follow-profile.command.ts similarity index 100% rename from src/modules/profile/application/commands/impl/follow-profile.command.ts rename to apps/profile/src/application/commands/impl/follow-profile.command.ts diff --git a/src/modules/profile/application/commands/impl/index.ts b/apps/profile/src/application/commands/impl/index.ts similarity index 100% rename from src/modules/profile/application/commands/impl/index.ts rename to apps/profile/src/application/commands/impl/index.ts diff --git a/src/modules/profile/application/commands/impl/unfollow-profile.command.ts b/apps/profile/src/application/commands/impl/unfollow-profile.command.ts similarity index 100% rename from src/modules/profile/application/commands/impl/unfollow-profile.command.ts rename to apps/profile/src/application/commands/impl/unfollow-profile.command.ts diff --git a/src/modules/profile/application/commands/index.ts b/apps/profile/src/application/commands/index.ts similarity index 100% rename from src/modules/profile/application/commands/index.ts rename to apps/profile/src/application/commands/index.ts diff --git a/src/modules/profile/application/queries/handlers/find-profile.handler.ts b/apps/profile/src/application/queries/handlers/find-profile.handler.ts similarity index 100% rename from src/modules/profile/application/queries/handlers/find-profile.handler.ts rename to apps/profile/src/application/queries/handlers/find-profile.handler.ts diff --git a/src/modules/profile/application/queries/handlers/index.ts b/apps/profile/src/application/queries/handlers/index.ts similarity index 100% rename from src/modules/profile/application/queries/handlers/index.ts rename to apps/profile/src/application/queries/handlers/index.ts diff --git a/src/modules/profile/application/queries/impl/find-profile.query.ts b/apps/profile/src/application/queries/impl/find-profile.query.ts similarity index 100% rename from src/modules/profile/application/queries/impl/find-profile.query.ts rename to apps/profile/src/application/queries/impl/find-profile.query.ts diff --git a/src/modules/profile/application/queries/impl/index.ts b/apps/profile/src/application/queries/impl/index.ts similarity index 100% rename from src/modules/profile/application/queries/impl/index.ts rename to apps/profile/src/application/queries/impl/index.ts diff --git a/src/modules/profile/application/queries/index.ts b/apps/profile/src/application/queries/index.ts similarity index 100% rename from src/modules/profile/application/queries/index.ts rename to apps/profile/src/application/queries/index.ts diff --git a/src/modules/profile/application/queries/query.module.ts b/apps/profile/src/application/queries/query.module.ts similarity index 100% rename from src/modules/profile/application/queries/query.module.ts rename to apps/profile/src/application/queries/query.module.ts diff --git a/src/modules/profile/application/services/index.ts b/apps/profile/src/application/services/index.ts similarity index 100% rename from src/modules/profile/application/services/index.ts rename to apps/profile/src/application/services/index.ts diff --git a/src/modules/profile/application/services/profile.service.ts b/apps/profile/src/application/services/profile.service.ts similarity index 100% rename from src/modules/profile/application/services/profile.service.ts rename to apps/profile/src/application/services/profile.service.ts diff --git a/src/modules/profile/core/entities/follows.entity.ts b/apps/profile/src/core/entities/follows.entity.ts similarity index 100% rename from src/modules/profile/core/entities/follows.entity.ts rename to apps/profile/src/core/entities/follows.entity.ts diff --git a/src/modules/profile/core/entities/index.ts b/apps/profile/src/core/entities/index.ts similarity index 100% rename from src/modules/profile/core/entities/index.ts rename to apps/profile/src/core/entities/index.ts diff --git a/src/modules/profile/core/enums/index.ts b/apps/profile/src/core/enums/index.ts similarity index 100% rename from src/modules/profile/core/enums/index.ts rename to apps/profile/src/core/enums/index.ts diff --git a/src/modules/profile/core/enums/profile.enum.ts b/apps/profile/src/core/enums/profile.enum.ts similarity index 100% rename from src/modules/profile/core/enums/profile.enum.ts rename to apps/profile/src/core/enums/profile.enum.ts diff --git a/src/modules/profile/core/index.ts b/apps/profile/src/core/index.ts similarity index 100% rename from src/modules/profile/core/index.ts rename to apps/profile/src/core/index.ts diff --git a/src/modules/profile/core/interfaces/index.ts b/apps/profile/src/core/interfaces/index.ts similarity index 100% rename from src/modules/profile/core/interfaces/index.ts rename to apps/profile/src/core/interfaces/index.ts diff --git a/src/modules/profile/core/interfaces/profile.interface.ts b/apps/profile/src/core/interfaces/profile.interface.ts similarity index 100% rename from src/modules/profile/core/interfaces/profile.interface.ts rename to apps/profile/src/core/interfaces/profile.interface.ts diff --git a/src/modules/profile/core/ports/follow.port.ts b/apps/profile/src/core/ports/follow.port.ts similarity index 100% rename from src/modules/profile/core/ports/follow.port.ts rename to apps/profile/src/core/ports/follow.port.ts diff --git a/src/modules/profile/core/ports/index.ts b/apps/profile/src/core/ports/index.ts similarity index 100% rename from src/modules/profile/core/ports/index.ts rename to apps/profile/src/core/ports/index.ts diff --git a/src/modules/profile/core/token/index.ts b/apps/profile/src/core/token/index.ts similarity index 100% rename from src/modules/profile/core/token/index.ts rename to apps/profile/src/core/token/index.ts diff --git a/apps/profile/src/main.ts b/apps/profile/src/main.ts new file mode 100644 index 0000000..10a13e3 --- /dev/null +++ b/apps/profile/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { ProfileModule } from './profile.module'; + +async function bootstrap() { + const app = await NestFactory.create(ProfileModule); + await app.listen(3000); +} +bootstrap(); diff --git a/src/modules/profile/presentation/index.ts b/apps/profile/src/presentation/index.ts similarity index 100% rename from src/modules/profile/presentation/index.ts rename to apps/profile/src/presentation/index.ts diff --git a/src/modules/profile/presentation/rest/index.ts b/apps/profile/src/presentation/rest/index.ts similarity index 100% rename from src/modules/profile/presentation/rest/index.ts rename to apps/profile/src/presentation/rest/index.ts diff --git a/src/modules/profile/presentation/rest/profile.controller.ts b/apps/profile/src/presentation/rest/profile.controller.ts similarity index 100% rename from src/modules/profile/presentation/rest/profile.controller.ts rename to apps/profile/src/presentation/rest/profile.controller.ts diff --git a/apps/profile/src/profile.controller.spec.ts b/apps/profile/src/profile.controller.spec.ts new file mode 100644 index 0000000..44ad100 --- /dev/null +++ b/apps/profile/src/profile.controller.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { ProfileController } from './profile.controller'; +import { ProfileService } from './profile.service'; + +describe('ProfileController', () => { + let profileController: ProfileController; + + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [ProfileController], + providers: [ProfileService], + }).compile(); + + profileController = app.get(ProfileController); + }); + + describe('root', () => { + it('should return "Hello World!"', () => { + expect(profileController.getHello()).toBe('Hello World!'); + }); + }); +}); diff --git a/src/modules/profile/profile.module.ts b/apps/profile/src/profile.module.ts similarity index 100% rename from src/modules/profile/profile.module.ts rename to apps/profile/src/profile.module.ts diff --git a/apps/profile/src/profile.service.ts b/apps/profile/src/profile.service.ts new file mode 100644 index 0000000..16d824c --- /dev/null +++ b/apps/profile/src/profile.service.ts @@ -0,0 +1,8 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class ProfileService { + getHello(): string { + return 'Hello World!'; + } +} diff --git a/apps/profile/test/app.e2e-spec.ts b/apps/profile/test/app.e2e-spec.ts new file mode 100644 index 0000000..7113188 --- /dev/null +++ b/apps/profile/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { ProfileModule } from './../src/profile.module'; + +describe('ProfileController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [ProfileModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/apps/profile/test/jest-e2e.json b/apps/profile/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/profile/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/profile/tsconfig.app.json b/apps/profile/tsconfig.app.json new file mode 100644 index 0000000..98bc61f --- /dev/null +++ b/apps/profile/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/profile" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/src/modules/user/README.md b/apps/user/README.md similarity index 100% rename from src/modules/user/README.md rename to apps/user/README.md diff --git a/src/modules/user/application/commands/command.module.ts b/apps/user/src/application/commands/command.module.ts similarity index 100% rename from src/modules/user/application/commands/command.module.ts rename to apps/user/src/application/commands/command.module.ts diff --git a/src/modules/user/application/commands/handlers/create-user.handler.ts b/apps/user/src/application/commands/handlers/create-user.handler.ts similarity index 100% rename from src/modules/user/application/commands/handlers/create-user.handler.ts rename to apps/user/src/application/commands/handlers/create-user.handler.ts diff --git a/src/modules/user/application/commands/handlers/index.ts b/apps/user/src/application/commands/handlers/index.ts similarity index 100% rename from src/modules/user/application/commands/handlers/index.ts rename to apps/user/src/application/commands/handlers/index.ts diff --git a/src/modules/user/application/commands/handlers/update-user.handler.ts b/apps/user/src/application/commands/handlers/update-user.handler.ts similarity index 100% rename from src/modules/user/application/commands/handlers/update-user.handler.ts rename to apps/user/src/application/commands/handlers/update-user.handler.ts diff --git a/src/modules/user/application/commands/impl/create-user.command.ts b/apps/user/src/application/commands/impl/create-user.command.ts similarity index 100% rename from src/modules/user/application/commands/impl/create-user.command.ts rename to apps/user/src/application/commands/impl/create-user.command.ts diff --git a/src/modules/user/application/commands/impl/index.ts b/apps/user/src/application/commands/impl/index.ts similarity index 100% rename from src/modules/user/application/commands/impl/index.ts rename to apps/user/src/application/commands/impl/index.ts diff --git a/src/modules/user/application/commands/impl/update-user.command.ts b/apps/user/src/application/commands/impl/update-user.command.ts similarity index 100% rename from src/modules/user/application/commands/impl/update-user.command.ts rename to apps/user/src/application/commands/impl/update-user.command.ts diff --git a/src/modules/user/application/commands/index.ts b/apps/user/src/application/commands/index.ts similarity index 100% rename from src/modules/user/application/commands/index.ts rename to apps/user/src/application/commands/index.ts diff --git a/src/modules/user/application/queries/handlers/find-user-by-email.handler.ts b/apps/user/src/application/queries/handlers/find-user-by-email.handler.ts similarity index 100% rename from src/modules/user/application/queries/handlers/find-user-by-email.handler.ts rename to apps/user/src/application/queries/handlers/find-user-by-email.handler.ts diff --git a/src/modules/user/application/queries/handlers/find-user-by-id.handler.ts b/apps/user/src/application/queries/handlers/find-user-by-id.handler.ts similarity index 100% rename from src/modules/user/application/queries/handlers/find-user-by-id.handler.ts rename to apps/user/src/application/queries/handlers/find-user-by-id.handler.ts diff --git a/src/modules/user/application/queries/handlers/index.ts b/apps/user/src/application/queries/handlers/index.ts similarity index 100% rename from src/modules/user/application/queries/handlers/index.ts rename to apps/user/src/application/queries/handlers/index.ts diff --git a/src/modules/user/application/queries/handlers/login.handler.ts b/apps/user/src/application/queries/handlers/login.handler.ts similarity index 100% rename from src/modules/user/application/queries/handlers/login.handler.ts rename to apps/user/src/application/queries/handlers/login.handler.ts diff --git a/src/modules/user/application/queries/impl/find-user-by-email.query.ts b/apps/user/src/application/queries/impl/find-user-by-email.query.ts similarity index 100% rename from src/modules/user/application/queries/impl/find-user-by-email.query.ts rename to apps/user/src/application/queries/impl/find-user-by-email.query.ts diff --git a/src/modules/user/application/queries/impl/find-user-by-id.query.ts b/apps/user/src/application/queries/impl/find-user-by-id.query.ts similarity index 100% rename from src/modules/user/application/queries/impl/find-user-by-id.query.ts rename to apps/user/src/application/queries/impl/find-user-by-id.query.ts diff --git a/src/modules/user/application/queries/impl/index.ts b/apps/user/src/application/queries/impl/index.ts similarity index 100% rename from src/modules/user/application/queries/impl/index.ts rename to apps/user/src/application/queries/impl/index.ts diff --git a/src/modules/user/application/queries/impl/login.query.ts b/apps/user/src/application/queries/impl/login.query.ts similarity index 100% rename from src/modules/user/application/queries/impl/login.query.ts rename to apps/user/src/application/queries/impl/login.query.ts diff --git a/src/modules/user/application/queries/index.ts b/apps/user/src/application/queries/index.ts similarity index 100% rename from src/modules/user/application/queries/index.ts rename to apps/user/src/application/queries/index.ts diff --git a/src/modules/user/application/queries/query.module.ts b/apps/user/src/application/queries/query.module.ts similarity index 100% rename from src/modules/user/application/queries/query.module.ts rename to apps/user/src/application/queries/query.module.ts diff --git a/src/modules/user/application/services/auth.service.ts b/apps/user/src/application/services/auth.service.ts similarity index 100% rename from src/modules/user/application/services/auth.service.ts rename to apps/user/src/application/services/auth.service.ts diff --git a/src/modules/user/application/services/index.ts b/apps/user/src/application/services/index.ts similarity index 100% rename from src/modules/user/application/services/index.ts rename to apps/user/src/application/services/index.ts diff --git a/src/modules/user/application/services/user.service.ts b/apps/user/src/application/services/user.service.ts similarity index 100% rename from src/modules/user/application/services/user.service.ts rename to apps/user/src/application/services/user.service.ts diff --git a/src/modules/user/core/dto/create-user.dto.ts b/apps/user/src/core/dto/create-user.dto.ts similarity index 100% rename from src/modules/user/core/dto/create-user.dto.ts rename to apps/user/src/core/dto/create-user.dto.ts diff --git a/src/modules/user/core/dto/index.ts b/apps/user/src/core/dto/index.ts similarity index 100% rename from src/modules/user/core/dto/index.ts rename to apps/user/src/core/dto/index.ts diff --git a/src/modules/user/core/dto/login-user.dto.ts b/apps/user/src/core/dto/login-user.dto.ts similarity index 100% rename from src/modules/user/core/dto/login-user.dto.ts rename to apps/user/src/core/dto/login-user.dto.ts diff --git a/src/modules/user/core/dto/update-user.dto.ts b/apps/user/src/core/dto/update-user.dto.ts similarity index 100% rename from src/modules/user/core/dto/update-user.dto.ts rename to apps/user/src/core/dto/update-user.dto.ts diff --git a/src/modules/user/core/entities/index.ts b/apps/user/src/core/entities/index.ts similarity index 100% rename from src/modules/user/core/entities/index.ts rename to apps/user/src/core/entities/index.ts diff --git a/src/modules/user/core/entities/user.entity.ts b/apps/user/src/core/entities/user.entity.ts similarity index 100% rename from src/modules/user/core/entities/user.entity.ts rename to apps/user/src/core/entities/user.entity.ts diff --git a/src/modules/user/core/enums/index.ts b/apps/user/src/core/enums/index.ts similarity index 100% rename from src/modules/user/core/enums/index.ts rename to apps/user/src/core/enums/index.ts diff --git a/src/modules/user/core/enums/user.enum.ts b/apps/user/src/core/enums/user.enum.ts similarity index 100% rename from src/modules/user/core/enums/user.enum.ts rename to apps/user/src/core/enums/user.enum.ts diff --git a/src/modules/user/core/index.ts b/apps/user/src/core/index.ts similarity index 100% rename from src/modules/user/core/index.ts rename to apps/user/src/core/index.ts diff --git a/src/modules/user/core/interfaces/index.ts b/apps/user/src/core/interfaces/index.ts similarity index 100% rename from src/modules/user/core/interfaces/index.ts rename to apps/user/src/core/interfaces/index.ts diff --git a/src/modules/user/core/interfaces/user.interface.ts b/apps/user/src/core/interfaces/user.interface.ts similarity index 100% rename from src/modules/user/core/interfaces/user.interface.ts rename to apps/user/src/core/interfaces/user.interface.ts diff --git a/src/modules/user/core/ports/index.ts b/apps/user/src/core/ports/index.ts similarity index 100% rename from src/modules/user/core/ports/index.ts rename to apps/user/src/core/ports/index.ts diff --git a/src/modules/user/core/ports/user.port.ts b/apps/user/src/core/ports/user.port.ts similarity index 100% rename from src/modules/user/core/ports/user.port.ts rename to apps/user/src/core/ports/user.port.ts diff --git a/src/modules/user/core/token/index.ts b/apps/user/src/core/token/index.ts similarity index 100% rename from src/modules/user/core/token/index.ts rename to apps/user/src/core/token/index.ts diff --git a/apps/user/src/main.ts b/apps/user/src/main.ts new file mode 100644 index 0000000..787f1d6 --- /dev/null +++ b/apps/user/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { UserModule } from './user.module'; + +async function bootstrap() { + const app = await NestFactory.create(UserModule); + await app.listen(3000); +} +bootstrap(); diff --git a/src/modules/user/presentation/index.ts b/apps/user/src/presentation/index.ts similarity index 100% rename from src/modules/user/presentation/index.ts rename to apps/user/src/presentation/index.ts diff --git a/src/modules/user/presentation/rest/index.ts b/apps/user/src/presentation/rest/index.ts similarity index 100% rename from src/modules/user/presentation/rest/index.ts rename to apps/user/src/presentation/rest/index.ts diff --git a/src/modules/user/presentation/rest/user.controller.ts b/apps/user/src/presentation/rest/user.controller.ts similarity index 100% rename from src/modules/user/presentation/rest/user.controller.ts rename to apps/user/src/presentation/rest/user.controller.ts diff --git a/src/modules/user/user.module.ts b/apps/user/src/user.module.ts similarity index 100% rename from src/modules/user/user.module.ts rename to apps/user/src/user.module.ts diff --git a/apps/user/test/app.e2e-spec.ts b/apps/user/test/app.e2e-spec.ts new file mode 100644 index 0000000..8b872b2 --- /dev/null +++ b/apps/user/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { UserModule } from './../src/user.module'; + +describe('UserController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [UserModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/apps/user/test/jest-e2e.json b/apps/user/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/user/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/user/tsconfig.app.json b/apps/user/tsconfig.app.json new file mode 100644 index 0000000..118b506 --- /dev/null +++ b/apps/user/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/user" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/assets/architect.png b/assets/architect.png index 225d156..ef20164 100644 Binary files a/assets/architect.png and b/assets/architect.png differ diff --git a/cdc/.gitignore b/cdc/.gitignore new file mode 100644 index 0000000..c655184 --- /dev/null +++ b/cdc/.gitignore @@ -0,0 +1,2 @@ +**.DS_Store +.idea/* \ No newline at end of file diff --git a/cdc/configs/es-indexes/es-article-index.json b/cdc/configs/es-indexes/es-article-index.json new file mode 100644 index 0000000..ba6e462 --- /dev/null +++ b/cdc/configs/es-indexes/es-article-index.json @@ -0,0 +1,40 @@ +{ + "settings": { + "number_of_shards": 2, + "analysis": { + "analyzer": { + "article_title": { + "tokenizer": "standard", + "filter": ["lowercase", "asciifolding"] + } + } + } + }, + "mappings": { + "_doc": { + "properties": { + "id": { "type": "integer" }, + "slug": { "type": "keyword" }, + "title": { + "type": "text", + "analyzer": "article_title" + }, + "description": { "type": "text" }, + "created": { "type": "date" }, + "updated": { "type": "date" }, + "readingTime": { "type": "float" }, + "tagList": { + "type": "keyword" + }, + "author": { + "type": "nested", + "properties": { + "id": { "type": "integer" } + } + }, + "favoriteCount": { "type": "integer" }, + "commentCount": { "type": "integer" } + } + } + } +} diff --git a/cdc/configs/sink-connectors/es-article-sink.json b/cdc/configs/sink-connectors/es-article-sink.json new file mode 100644 index 0000000..0cbe321 --- /dev/null +++ b/cdc/configs/sink-connectors/es-article-sink.json @@ -0,0 +1,26 @@ +{ + "name": "es-article-sink", + "config": { + "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", + "tasks.max": "1", + "topics": "cdc.social.public.article", + "connection.url": "http://elasticsearch:9200", + + "type.name": "_doc", + "key.converter": "io.confluent.connect.avro.AvroConverter", + "value.converter": "io.confluent.connect.avro.AvroConverter", + "key.converter.schema.registry.url": "http://schema-registry:8081", + "value.converter.schema.registry.url": "http://schema-registry:8081", + "value.converter.schemas.enable": "false", + "schema.ignore": "true", + "key.ignore": "false", + "behavior.on.null.values": "delete", + + "transforms": "unwrap,key", + "transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState", + "transforms.key.type": "org.apache.kafka.connect.transforms.ExtractField$Key", + "transforms.key.field": "id", + "transforms.unwrap.drop.tombstones": "false", + "transforms.unwrap.drop.deletes": "false" + } +} diff --git a/cdc/configs/source-connectors/postgres-article-source.json b/cdc/configs/source-connectors/postgres-article-source.json new file mode 100644 index 0000000..46aa094 --- /dev/null +++ b/cdc/configs/source-connectors/postgres-article-source.json @@ -0,0 +1,35 @@ +{ + "name": "postgres-article-source", + "config": { + "connector.class": "io.debezium.connector.postgresql.PostgresConnector", + "tasks.max": "1", + "plugin.name": "pgoutput", + + "database.hostname": "postgres", + "database.port": "5432", + "database.user": "postgres", + "database.password": "pgadmin", + "database.dbname": "social", + "schema.include.list": "public", + "include.schema.changes": "true", + "database.server.name": "postgre-article", + "database.server.id": "5401", + + "database.history.kafka.bootstrap.servers": "kafka:9092", + "database.history.kafka.topic": "public.history", + + "key.converter": "io.confluent.connect.avro.AvroConverter", + "value.converter": "io.confluent.connect.avro.AvroConverter", + "key.converter.schema.registry.url": "http://schema-registry:8081", + "value.converter.schema.registry.url": "http://schema-registry:8081", + "key.converter.schemas.enable": "true", + "value.converter.schemas.enable": "true", + + "transforms": "Reroute", + "transforms.Reroute.type": "io.debezium.transforms.ByLogicalTableRouter", + "transforms.Reroute.topic.regex": "(.*)article", + "transforms.Reroute.topic.replacement": "cdc.social.public.article", + "transforms.Reroute.key.field.name": "id", + "transforms.Reroute.key.enforce.uniqueness": "false" + } +} diff --git a/cdc/debezium-connect/Dockerfile b/cdc/debezium-connect/Dockerfile new file mode 100644 index 0000000..7de674d --- /dev/null +++ b/cdc/debezium-connect/Dockerfile @@ -0,0 +1,19 @@ +ARG DEBEZIUM_VERSION +FROM debezium/connect:${DEBEZIUM_VERSION} + +ENV KAFKA_CONNECT_JDBC_DIR=$KAFKA_CONNECT_PLUGINS_DIR/kafka-connect-jdbc +ENV KAFKA_CONNECT_ES_DIR=$KAFKA_CONNECT_PLUGINS_DIR/kafka-connect-elasticsearch + +ARG POSTGRES_VERSION=42.3.1 +ARG KAFKA_JDBC_VERSION=10.0.0 + +# Deploy PostgreSQL JDBC Driver +RUN cd /kafka/libs && curl -sO https://jdbc.postgresql.org/download/postgresql-$POSTGRES_VERSION.jar + +# Deploy Kafka Connect JDBC +RUN mkdir $KAFKA_CONNECT_JDBC_DIR && cd $KAFKA_CONNECT_JDBC_DIR +COPY kafka-connect-jdbc $KAFKA_CONNECT_JDBC_DIR + +# Deploy Confluent Elasticsearch sink connector +RUN mkdir $KAFKA_CONNECT_ES_DIR && cd $KAFKA_CONNECT_ES_DIR +COPY kafka-connect-elasticsearch $KAFKA_CONNECT_ES_DIR \ No newline at end of file diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/HdrHistogram-2.1.9.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/HdrHistogram-2.1.9.jar new file mode 100644 index 0000000..efa2637 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/HdrHistogram-2.1.9.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/aggs-matrix-stats-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/aggs-matrix-stats-client-7.9.3.jar new file mode 100644 index 0000000..fbbf853 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/aggs-matrix-stats-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/common-utils-6.0.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/common-utils-6.0.3.jar new file mode 100644 index 0000000..dd3ff72 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/common-utils-6.0.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/commons-codec-1.15.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/commons-codec-1.15.jar new file mode 100644 index 0000000..f14985a Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/commons-codec-1.15.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/commons-logging-1.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/commons-logging-1.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/compiler-0.9.6.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/compiler-0.9.6.jar new file mode 100644 index 0000000..96578e3 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/compiler-0.9.6.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-7.9.3.jar new file mode 100644 index 0000000..d61f744 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-cli-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-cli-7.9.3.jar new file mode 100644 index 0000000..e0de9f7 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-cli-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-core-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-core-7.9.3.jar new file mode 100644 index 0000000..397dd82 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-core-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-geo-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-geo-7.9.3.jar new file mode 100644 index 0000000..3e1d72e Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-geo-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-client-7.9.3.jar new file mode 100644 index 0000000..3c519c3 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-high-level-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-high-level-client-7.9.3.jar new file mode 100644 index 0000000..eef6ec9 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-rest-high-level-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-secure-sm-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-secure-sm-7.9.3.jar new file mode 100644 index 0000000..260ea95 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-secure-sm-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-x-content-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-x-content-7.9.3.jar new file mode 100644 index 0000000..77e3545 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/elasticsearch-x-content-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/hppc-0.8.1.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/hppc-0.8.1.jar new file mode 100644 index 0000000..39a7c24 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/hppc-0.8.1.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/httpasyncclient-4.1.4.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/httpasyncclient-4.1.4.jar new file mode 100644 index 0000000..e6b3b29 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/httpasyncclient-4.1.4.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/httpclient-4.5.13.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/httpclient-4.5.13.jar new file mode 100644 index 0000000..218ee25 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/httpclient-4.5.13.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-4.4.13.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-4.4.13.jar new file mode 100644 index 0000000..163dc43 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-4.4.13.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-nio-4.4.12.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-nio-4.4.12.jar new file mode 100644 index 0000000..b6183e6 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/httpcore-nio-4.4.12.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-annotations-2.10.5.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-annotations-2.10.5.jar new file mode 100644 index 0000000..74a8b1b Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-annotations-2.10.5.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-core-2.10.5.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-core-2.10.5.jar new file mode 100644 index 0000000..ed18173 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-core-2.10.5.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-databind-2.10.5.1.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-databind-2.10.5.1.jar new file mode 100644 index 0000000..3246c3d Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-databind-2.10.5.1.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-cbor-2.11.4.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-cbor-2.11.4.jar new file mode 100644 index 0000000..864278f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-cbor-2.11.4.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-smile-2.10.5.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-smile-2.10.5.jar new file mode 100644 index 0000000..d1d5400 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-smile-2.10.5.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-yaml-2.10.5.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-yaml-2.10.5.jar new file mode 100644 index 0000000..e71c6bc Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jackson-dataformat-yaml-2.10.5.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jna-5.5.0.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jna-5.5.0.jar new file mode 100644 index 0000000..6612398 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jna-5.5.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/joda-time-2.10.4.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/joda-time-2.10.4.jar new file mode 100644 index 0000000..62c7a53 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/joda-time-2.10.4.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/jopt-simple-5.0.4.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/jopt-simple-5.0.4.jar new file mode 100644 index 0000000..317b2b0 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/jopt-simple-5.0.4.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/kafka-connect-elasticsearch-11.1.7.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/kafka-connect-elasticsearch-11.1.7.jar new file mode 100644 index 0000000..8ebce33 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/kafka-connect-elasticsearch-11.1.7.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lang-mustache-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lang-mustache-client-7.9.3.jar new file mode 100644 index 0000000..3bb2299 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lang-mustache-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/log4j-api-2.16.0.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/log4j-api-2.16.0.jar new file mode 100644 index 0000000..2fea718 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/log4j-api-2.16.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-analyzers-common-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-analyzers-common-8.6.2.jar new file mode 100644 index 0000000..8abf45f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-analyzers-common-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-backward-codecs-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-backward-codecs-8.6.2.jar new file mode 100644 index 0000000..9fc41c2 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-backward-codecs-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-core-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-core-8.6.2.jar new file mode 100644 index 0000000..87918a7 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-core-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-grouping-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-grouping-8.6.2.jar new file mode 100644 index 0000000..75e0783 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-grouping-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-highlighter-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-highlighter-8.6.2.jar new file mode 100644 index 0000000..c039a7e Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-highlighter-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-join-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-join-8.6.2.jar new file mode 100644 index 0000000..e109ffc Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-join-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-memory-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-memory-8.6.2.jar new file mode 100644 index 0000000..71cffb3 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-memory-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-misc-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-misc-8.6.2.jar new file mode 100644 index 0000000..5d264ac Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-misc-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queries-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queries-8.6.2.jar new file mode 100644 index 0000000..5feaf42 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queries-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queryparser-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queryparser-8.6.2.jar new file mode 100644 index 0000000..4b89bd2 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-queryparser-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-sandbox-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-sandbox-8.6.2.jar new file mode 100644 index 0000000..7dcbb61 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-sandbox-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial-extras-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial-extras-8.6.2.jar new file mode 100644 index 0000000..fd5325a Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial-extras-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial3d-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial3d-8.6.2.jar new file mode 100644 index 0000000..5ab5797 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-spatial3d-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-suggest-8.6.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-suggest-8.6.2.jar new file mode 100644 index 0000000..d9d6e7b Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/lucene-suggest-8.6.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/mapper-extras-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/mapper-extras-client-7.9.3.jar new file mode 100644 index 0000000..8482512 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/mapper-extras-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/parent-join-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/parent-join-client-7.9.3.jar new file mode 100644 index 0000000..df1f3e7 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/parent-join-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/rank-eval-client-7.9.3.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/rank-eval-client-7.9.3.jar new file mode 100644 index 0000000..9899fae Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/rank-eval-client-7.9.3.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/slf4j-api-1.7.30.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/slf4j-api-1.7.30.jar new file mode 100644 index 0000000..29ac26f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/slf4j-api-1.7.30.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/snakeyaml-1.27.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/snakeyaml-1.27.jar new file mode 100644 index 0000000..79bd430 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/snakeyaml-1.27.jar differ diff --git a/cdc/debezium-connect/kafka-connect-elasticsearch/t-digest-3.2.jar b/cdc/debezium-connect/kafka-connect-elasticsearch/t-digest-3.2.jar new file mode 100644 index 0000000..2f14401 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-elasticsearch/t-digest-3.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/checker-qual-3.5.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/checker-qual-3.5.0.jar new file mode 100644 index 0000000..f98cde8 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/checker-qual-3.5.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/common-utils-6.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/common-utils-6.0.0.jar new file mode 100644 index 0000000..b997233 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/common-utils-6.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/jtds-1.3.1.jar b/cdc/debezium-connect/kafka-connect-jdbc/jtds-1.3.1.jar new file mode 100644 index 0000000..518b425 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/jtds-1.3.1.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/kafka-connect-jdbc-10.3.x.jar b/cdc/debezium-connect/kafka-connect-jdbc/kafka-connect-jdbc-10.3.x.jar new file mode 100644 index 0000000..3e910d4 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/kafka-connect-jdbc-10.3.x.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/mssql-jdbc-8.4.1.jre8.jar b/cdc/debezium-connect/kafka-connect-jdbc/mssql-jdbc-8.4.1.jre8.jar new file mode 100644 index 0000000..ad0b4b5 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/mssql-jdbc-8.4.1.jre8.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-19.7.0.0.jar new file mode 100644 index 0000000..d37af5f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-production-19.7.0.0.pom b/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-production-19.7.0.0.pom new file mode 100644 index 0000000..fcfb8e4 --- /dev/null +++ b/cdc/debezium-connect/kafka-connect-jdbc/ojdbc8-production-19.7.0.0.pom @@ -0,0 +1,135 @@ + + + 4.0.0 + + com.oracle.database.jdbc + ojdbc8-production + 19.7.0.0 + pom + + + ojdbc8-production + Oracle JDBC Driver compatible with JDK8, JDK9, and JDK11 + https://www.oracle.com/database/technologies/maven-central-guide.html + 1997 + + + + Oracle Free Use Terms and Conditions (FUTC) + + https://www.oracle.com/downloads/licenses/oracle-free-license.html + + + + + + + Oracle America, Inc. + http://www.oracle.com + + + + + + + + + + com.oracle.database.jdbc + ojdbc-bom + 19.7.0.0 + pom + import + + + + + + + + + com.oracle.database.jdbc + ojdbc8 + + + + + com.oracle.database.jdbc + ucp + + + + + + com.oracle.database.security + oraclepki + + + + com.oracle.database.security + osdt_cert + + + + com.oracle.database.security + osdt_core + + + + + + com.oracle.database.ha + simplefan + + + + com.oracle.database.ha + ons + + + + + com.oracle.database.nls + orai18n + + + + + com.oracle.database.xml + xdb + + + + + com.oracle.database.xml + xmlparserv2 + + + + + + diff --git a/cdc/debezium-connect/kafka-connect-jdbc/ons-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/ons-19.7.0.0.jar new file mode 100644 index 0000000..d0b3c67 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/ons-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/oraclepki-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/oraclepki-19.7.0.0.jar new file mode 100644 index 0000000..5351a42 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/oraclepki-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/orai18n-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/orai18n-19.7.0.0.jar new file mode 100644 index 0000000..8e82f27 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/orai18n-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/osdt_cert-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/osdt_cert-19.7.0.0.jar new file mode 100644 index 0000000..6f7c908 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/osdt_cert-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/osdt_core-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/osdt_core-19.7.0.0.jar new file mode 100644 index 0000000..9a0598a Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/osdt_core-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/postgresql-42.2.19.jar b/cdc/debezium-connect/kafka-connect-jdbc/postgresql-42.2.19.jar new file mode 100644 index 0000000..eb818ef Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/postgresql-42.2.19.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/simplefan-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/simplefan-19.7.0.0.jar new file mode 100644 index 0000000..f5a1a33 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/simplefan-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/slf4j-api-1.7.30.jar b/cdc/debezium-connect/kafka-connect-jdbc/slf4j-api-1.7.30.jar new file mode 100644 index 0000000..29ac26f Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/slf4j-api-1.7.30.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/sqlite-jdbc-3.25.2.jar b/cdc/debezium-connect/kafka-connect-jdbc/sqlite-jdbc-3.25.2.jar new file mode 100644 index 0000000..abec989 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/sqlite-jdbc-3.25.2.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/ucp-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/ucp-19.7.0.0.jar new file mode 100644 index 0000000..3919144 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/ucp-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/xdb-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/xdb-19.7.0.0.jar new file mode 100644 index 0000000..1d32df2 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/xdb-19.7.0.0.jar differ diff --git a/cdc/debezium-connect/kafka-connect-jdbc/xmlparserv2-19.7.0.0.jar b/cdc/debezium-connect/kafka-connect-jdbc/xmlparserv2-19.7.0.0.jar new file mode 100644 index 0000000..0b40d48 Binary files /dev/null and b/cdc/debezium-connect/kafka-connect-jdbc/xmlparserv2-19.7.0.0.jar differ diff --git a/cdc/deploy-configurations.sh b/cdc/deploy-configurations.sh new file mode 100644 index 0000000..5b9f0ca --- /dev/null +++ b/cdc/deploy-configurations.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# setup elasticsearch indices +curl -i -X PUT -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:9200/article?include_type_name=true -d @configs/es-indexes/es-article-index.json + +# setup elasticsearch sink +curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @configs/sink-connectors/es-article-sink.json + +# setup connector +curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @configs/source-connectors/postgres-article-source.json \ No newline at end of file diff --git a/cdc/docker-compose.yml b/cdc/docker-compose.yml new file mode 100644 index 0000000..e5e5a9e --- /dev/null +++ b/cdc/docker-compose.yml @@ -0,0 +1,89 @@ +version: '3.9' + +services: + zookeeper: + container_name: cdc_zookeeper + image: debezium/zookeeper:${DEBEZIUM_VERSION} + restart: always + ports: + - "2181:2181" + - "2888:2888" + - "3888:3888" + + kafka: + container_name: cdc_kafka + image: debezium/kafka:${DEBEZIUM_VERSION} + restart: always + ports: + - "9092:9092" + links: + - zookeeper + environment: + - ZOOKEEPER_CONNECT=zookeeper:2181 + + postgres: + container_name: cdc_postgres + build: ./postgresql + restart: always + ports: + - "5432:5432" + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=pgadmin + + schema_registry: + image: confluentinc/cp-schema-registry + container_name: cdc_schema_registry + hostname: schema-registry + restart: always + depends_on: + - zookeeper + - kafka + ports: + - 8181:8181 + - 8081:8081 + environment: + - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=zookeeper:2181 + - SCHEMA_REGISTRY_HOST_NAME=schema-registry + - SCHEMA_REGISTRY_LISTENERS=http://schema-registry:8081 + - SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS=//kafka:9092 + + connect: + container_name: cdc_connect + build: + context: ./debezium-connect + args: + - DEBEZIUM_VERSION=${DEBEZIUM_VERSION} + ports: + - "8083:8083" + links: + - kafka + - postgres + - elasticsearch + environment: + - BOOTSTRAP_SERVERS=kafka:9092 + - GROUP_ID=1 + - CONFIG_STORAGE_TOPIC=my_connect_configs + - OFFSET_STORAGE_TOPIC=my_connect_offsets + - STATUS_STORAGE_TOPIC=my_connect_statuses + - KEY_CONVERTER=io.confluent.connect.avro.AvroConverter + - VALUE_CONVERTER=io.confluent.connect.avro.AvroConverter + - CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL=http://schema-registry:8081 + - CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL=http://schema-registry:8081 + - INTERNAL_KEY_CONVERTER=org.apache.kafka.connect.json.JsonConverter + - INTERNAL_VALUE_CONVERTER=org.apache.kafka.connect.json.JsonConverter + + elasticsearch: + container_name: cdc_elasticsearch + image: docker.elastic.co/elasticsearch/elasticsearch:7.0.0 + restart: always + ports: + - "9200:9200" + environment: + - http.host=0.0.0.0 + - transport.host=127.0.0.1 + - xpack.security.enabled=false + - "discovery.type=single-node" + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - http.cors.enabled=true + - http.cors.allow-origin="http://localhost:8080" \ No newline at end of file diff --git a/cdc/postgresql/Dockerfile b/cdc/postgresql/Dockerfile new file mode 100644 index 0000000..e9552b8 --- /dev/null +++ b/cdc/postgresql/Dockerfile @@ -0,0 +1 @@ +FROM debezium/postgres:14-alpine diff --git a/cdc/remove-configurations.sh b/cdc/remove-configurations.sh new file mode 100644 index 0000000..c0f3e3b --- /dev/null +++ b/cdc/remove-configurations.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# remove source connector +curl -i -X DELETE localhost:8083/connectors/postgres-article-source + +# remove sink connector +curl -i -X DELETE localhost:8083/connectors/es-article-sink + +# remove indices +curl -X DELETE "localhost:9200/article" diff --git a/src/configs/README.md b/devops/.gitkeep similarity index 100% rename from src/configs/README.md rename to devops/.gitkeep diff --git a/src/shared/README.md b/devops/docker-compose/.gitkeep similarity index 100% rename from src/shared/README.md rename to devops/docker-compose/.gitkeep diff --git a/devops/dockerfiles/.gitkeep b/devops/dockerfiles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/devops/envs/.gitkeep b/devops/envs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/libs/auth/src/auth.module.ts b/libs/auth/src/auth.module.ts new file mode 100644 index 0000000..0ad65bd --- /dev/null +++ b/libs/auth/src/auth.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; +import { AuthService } from './auth.service'; + +@Module({ + providers: [AuthService], + exports: [AuthService], +}) +export class AuthModule {} diff --git a/libs/auth/src/auth.service.spec.ts b/libs/auth/src/auth.service.spec.ts new file mode 100644 index 0000000..800ab66 --- /dev/null +++ b/libs/auth/src/auth.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AuthService } from './auth.service'; + +describe('AuthService', () => { + let service: AuthService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [AuthService], + }).compile(); + + service = module.get(AuthService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/libs/auth/src/auth.service.ts b/libs/auth/src/auth.service.ts new file mode 100644 index 0000000..a41c649 --- /dev/null +++ b/libs/auth/src/auth.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class AuthService {} diff --git a/libs/auth/src/index.ts b/libs/auth/src/index.ts new file mode 100644 index 0000000..96d7b58 --- /dev/null +++ b/libs/auth/src/index.ts @@ -0,0 +1,2 @@ +export * from './auth.module'; +export * from './auth.service'; diff --git a/libs/auth/tsconfig.lib.json b/libs/auth/tsconfig.lib.json new file mode 100644 index 0000000..8c25278 --- /dev/null +++ b/libs/auth/tsconfig.lib.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "../../dist/libs/auth" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/libs/persistence/src/di-tokens/index.ts b/libs/persistence/src/di-tokens/index.ts new file mode 100644 index 0000000..146011e --- /dev/null +++ b/libs/persistence/src/di-tokens/index.ts @@ -0,0 +1,13 @@ +export const USER_REPOSITORY = "USER_REPOSITORY"; + +export const ARTICLE_REPOSITORY = "ARTICLE_REPOSITORY"; + +export const BLOCK_REPOSITORY = "BLOCK_REPOSITORY"; + +export const COMMENT_REPOSITORY = "COMMENT_REPOSITORY"; + +export const FOLLOW_REPOSITORY = "FOLLOW_REPOSITORY"; + +export const TAG_REPOSITORY = "TAG_REPOSITORY"; + +export const MEDIA_REPOSITORY = "MEDIA_REPOSITORY"; diff --git a/libs/persistence/src/index.ts b/libs/persistence/src/index.ts new file mode 100644 index 0000000..484a5ab --- /dev/null +++ b/libs/persistence/src/index.ts @@ -0,0 +1,2 @@ +export * from './persistence.module'; +export * from './persistence.service'; diff --git a/src/infrastructure/persistence/migrations/1662609707249-create-db.ts b/libs/persistence/src/migrations/1662609707249-create-db.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1662609707249-create-db.ts rename to libs/persistence/src/migrations/1662609707249-create-db.ts diff --git a/src/infrastructure/persistence/migrations/1671173831369-create-table-block.ts b/libs/persistence/src/migrations/1671173831369-create-table-block.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1671173831369-create-table-block.ts rename to libs/persistence/src/migrations/1671173831369-create-table-block.ts diff --git a/src/infrastructure/persistence/migrations/1671177119327-update-table-block.ts b/libs/persistence/src/migrations/1671177119327-update-table-block.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1671177119327-update-table-block.ts rename to libs/persistence/src/migrations/1671177119327-update-table-block.ts diff --git a/src/infrastructure/persistence/migrations/1671276172761-wip.ts b/libs/persistence/src/migrations/1671276172761-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1671276172761-wip.ts rename to libs/persistence/src/migrations/1671276172761-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672246219171-wip.ts b/libs/persistence/src/migrations/1672246219171-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672246219171-wip.ts rename to libs/persistence/src/migrations/1672246219171-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672246296869-wip.ts b/libs/persistence/src/migrations/1672246296869-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672246296869-wip.ts rename to libs/persistence/src/migrations/1672246296869-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672246339821-wip.ts b/libs/persistence/src/migrations/1672246339821-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672246339821-wip.ts rename to libs/persistence/src/migrations/1672246339821-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672246901416-wip.ts b/libs/persistence/src/migrations/1672246901416-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672246901416-wip.ts rename to libs/persistence/src/migrations/1672246901416-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672247924138-wip.ts b/libs/persistence/src/migrations/1672247924138-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672247924138-wip.ts rename to libs/persistence/src/migrations/1672247924138-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672248147109-wip.ts b/libs/persistence/src/migrations/1672248147109-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672248147109-wip.ts rename to libs/persistence/src/migrations/1672248147109-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672463269770-wip.ts b/libs/persistence/src/migrations/1672463269770-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672463269770-wip.ts rename to libs/persistence/src/migrations/1672463269770-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672463319374-wip.ts b/libs/persistence/src/migrations/1672463319374-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672463319374-wip.ts rename to libs/persistence/src/migrations/1672463319374-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672475335274-wip.ts b/libs/persistence/src/migrations/1672475335274-wip.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672475335274-wip.ts rename to libs/persistence/src/migrations/1672475335274-wip.ts diff --git a/src/infrastructure/persistence/migrations/1672742324539-update-table-comment.ts b/libs/persistence/src/migrations/1672742324539-update-table-comment.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672742324539-update-table-comment.ts rename to libs/persistence/src/migrations/1672742324539-update-table-comment.ts diff --git a/src/infrastructure/persistence/migrations/1672846462638-create-index.ts b/libs/persistence/src/migrations/1672846462638-create-index.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1672846462638-create-index.ts rename to libs/persistence/src/migrations/1672846462638-create-index.ts diff --git a/src/infrastructure/persistence/migrations/1673753891989-full-text-search.ts b/libs/persistence/src/migrations/1673753891989-full-text-search.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1673753891989-full-text-search.ts rename to libs/persistence/src/migrations/1673753891989-full-text-search.ts diff --git a/src/infrastructure/persistence/migrations/1674751970460-update-write-db.ts b/libs/persistence/src/migrations/1674751970460-update-write-db.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1674751970460-update-write-db.ts rename to libs/persistence/src/migrations/1674751970460-update-write-db.ts diff --git a/src/infrastructure/persistence/migrations/1706607288006-Update-Article-Table.ts b/libs/persistence/src/migrations/1706607288006-Update-Article-Table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1706607288006-Update-Article-Table.ts rename to libs/persistence/src/migrations/1706607288006-Update-Article-Table.ts diff --git a/src/infrastructure/persistence/migrations/1706607601995-Update-Article-Table.ts b/libs/persistence/src/migrations/1706607601995-Update-Article-Table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/1706607601995-Update-Article-Table.ts rename to libs/persistence/src/migrations/1706607601995-Update-Article-Table.ts diff --git a/src/infrastructure/persistence/migrations/master/1701054117351-create-file-table.ts b/libs/persistence/src/migrations/master/1701054117351-create-file-table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/master/1701054117351-create-file-table.ts rename to libs/persistence/src/migrations/master/1701054117351-create-file-table.ts diff --git a/src/infrastructure/persistence/migrations/master/1701054864756-alter-file-table.ts b/libs/persistence/src/migrations/master/1701054864756-alter-file-table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/master/1701054864756-alter-file-table.ts rename to libs/persistence/src/migrations/master/1701054864756-alter-file-table.ts diff --git a/src/infrastructure/persistence/migrations/master/1701055666137-WIP.ts b/libs/persistence/src/migrations/master/1701055666137-WIP.ts similarity index 100% rename from src/infrastructure/persistence/migrations/master/1701055666137-WIP.ts rename to libs/persistence/src/migrations/master/1701055666137-WIP.ts diff --git a/src/infrastructure/persistence/migrations/master/1701072210617-WIP.ts b/libs/persistence/src/migrations/master/1701072210617-WIP.ts similarity index 100% rename from src/infrastructure/persistence/migrations/master/1701072210617-WIP.ts rename to libs/persistence/src/migrations/master/1701072210617-WIP.ts diff --git a/src/infrastructure/persistence/migrations/slave/1701054160506-create-file-table.ts b/libs/persistence/src/migrations/slave/1701054160506-create-file-table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/slave/1701054160506-create-file-table.ts rename to libs/persistence/src/migrations/slave/1701054160506-create-file-table.ts diff --git a/src/infrastructure/persistence/migrations/slave/1701054899462-alter-file-table.ts b/libs/persistence/src/migrations/slave/1701054899462-alter-file-table.ts similarity index 100% rename from src/infrastructure/persistence/migrations/slave/1701054899462-alter-file-table.ts rename to libs/persistence/src/migrations/slave/1701054899462-alter-file-table.ts diff --git a/src/infrastructure/persistence/migrations/slave/1701055694417-WIP.ts b/libs/persistence/src/migrations/slave/1701055694417-WIP.ts similarity index 100% rename from src/infrastructure/persistence/migrations/slave/1701055694417-WIP.ts rename to libs/persistence/src/migrations/slave/1701055694417-WIP.ts diff --git a/src/infrastructure/persistence/migrations/slave/1701072227823-WIP.ts b/libs/persistence/src/migrations/slave/1701072227823-WIP.ts similarity index 100% rename from src/infrastructure/persistence/migrations/slave/1701072227823-WIP.ts rename to libs/persistence/src/migrations/slave/1701072227823-WIP.ts diff --git a/libs/persistence/src/persistence.module.ts b/libs/persistence/src/persistence.module.ts new file mode 100644 index 0000000..b354d7c --- /dev/null +++ b/libs/persistence/src/persistence.module.ts @@ -0,0 +1,10 @@ +import { Module } from "@nestjs/common"; +import { PersistenceService } from "./persistence.service"; + +@Module({ + providers: [PersistenceService], + exports: [PersistenceService], +}) +export class PersistenceModule {} + +// TODO: Implement DI here for repository includes: DI_Token and Repository diff --git a/libs/persistence/src/persistence.service.spec.ts b/libs/persistence/src/persistence.service.spec.ts new file mode 100644 index 0000000..1502099 --- /dev/null +++ b/libs/persistence/src/persistence.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { PersistenceService } from './persistence.service'; + +describe('PersistenceService', () => { + let service: PersistenceService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [PersistenceService], + }).compile(); + + service = module.get(PersistenceService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/libs/persistence/src/persistence.service.ts b/libs/persistence/src/persistence.service.ts new file mode 100644 index 0000000..7eac8f7 --- /dev/null +++ b/libs/persistence/src/persistence.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class PersistenceService {} diff --git a/src/infrastructure/persistence/repositories/article.repository.ts b/libs/persistence/src/repositories/article.repository.ts similarity index 95% rename from src/infrastructure/persistence/repositories/article.repository.ts rename to libs/persistence/src/repositories/article.repository.ts index 0c4c79f..ccd510d 100644 --- a/src/infrastructure/persistence/repositories/article.repository.ts +++ b/libs/persistence/src/repositories/article.repository.ts @@ -3,7 +3,7 @@ import { InjectRepository } from "@nestjs/typeorm"; import { DeepPartial, DeleteResult, - FindConditions, + FindOneOptions, FindManyOptions, FindOneOptions, QueryRunner, @@ -45,7 +45,7 @@ export class ArticleRepository implements ArticlePort { options?: FindOneOptions ): Promise; findOne( - conditions?: FindConditions, + conditions?: FindOneOptions, options?: FindOneOptions ): Promise; async findOne( @@ -53,7 +53,7 @@ export class ArticleRepository implements ArticlePort { | [id?: string | number, options?: FindOneOptions] | [options?: FindOneOptions] | [ - conditions?: FindConditions, + conditions?: FindOneOptions, options?: FindOneOptions ] ): Promise { diff --git a/src/infrastructure/persistence/repositories/block.repository.ts b/libs/persistence/src/repositories/block.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/block.repository.ts rename to libs/persistence/src/repositories/block.repository.ts diff --git a/src/infrastructure/persistence/repositories/comment.repository.ts b/libs/persistence/src/repositories/comment.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/comment.repository.ts rename to libs/persistence/src/repositories/comment.repository.ts diff --git a/src/infrastructure/persistence/repositories/file.repository.ts b/libs/persistence/src/repositories/file.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/file.repository.ts rename to libs/persistence/src/repositories/file.repository.ts diff --git a/src/infrastructure/persistence/repositories/follow.repository.ts b/libs/persistence/src/repositories/follow.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/follow.repository.ts rename to libs/persistence/src/repositories/follow.repository.ts diff --git a/src/infrastructure/persistence/repositories/repository.module.ts b/libs/persistence/src/repositories/repository.module.ts similarity index 100% rename from src/infrastructure/persistence/repositories/repository.module.ts rename to libs/persistence/src/repositories/repository.module.ts diff --git a/src/infrastructure/persistence/repositories/tag.repository.ts b/libs/persistence/src/repositories/tag.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/tag.repository.ts rename to libs/persistence/src/repositories/tag.repository.ts diff --git a/src/infrastructure/persistence/repositories/user.repository.ts b/libs/persistence/src/repositories/user.repository.ts similarity index 100% rename from src/infrastructure/persistence/repositories/user.repository.ts rename to libs/persistence/src/repositories/user.repository.ts diff --git a/libs/persistence/tsconfig.lib.json b/libs/persistence/tsconfig.lib.json new file mode 100644 index 0000000..6e5a670 --- /dev/null +++ b/libs/persistence/tsconfig.lib.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "../../dist/libs/persistence" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/src/infrastructure/redis/README.md b/libs/redis/src/README.md similarity index 100% rename from src/infrastructure/redis/README.md rename to libs/redis/src/README.md diff --git a/libs/redis/src/index.ts b/libs/redis/src/index.ts new file mode 100644 index 0000000..c82b927 --- /dev/null +++ b/libs/redis/src/index.ts @@ -0,0 +1,2 @@ +export * from './redis.module'; +export * from './redis.service'; diff --git a/src/infrastructure/redis/redis.constant.ts b/libs/redis/src/redis.constant.ts similarity index 100% rename from src/infrastructure/redis/redis.constant.ts rename to libs/redis/src/redis.constant.ts diff --git a/src/infrastructure/redis/redis.module.ts b/libs/redis/src/redis.module.ts similarity index 100% rename from src/infrastructure/redis/redis.module.ts rename to libs/redis/src/redis.module.ts diff --git a/libs/redis/src/redis.service.spec.ts b/libs/redis/src/redis.service.spec.ts new file mode 100644 index 0000000..9300ac3 --- /dev/null +++ b/libs/redis/src/redis.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { RedisService } from './redis.service'; + +describe('RedisService', () => { + let service: RedisService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [RedisService], + }).compile(); + + service = module.get(RedisService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/infrastructure/redis/redis.service.ts b/libs/redis/src/redis.service.ts similarity index 100% rename from src/infrastructure/redis/redis.service.ts rename to libs/redis/src/redis.service.ts diff --git a/libs/redis/tsconfig.lib.json b/libs/redis/tsconfig.lib.json new file mode 100644 index 0000000..1f4c603 --- /dev/null +++ b/libs/redis/tsconfig.lib.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "../../dist/libs/redis" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/nest-cli.json b/nest-cli.json new file mode 100644 index 0000000..0219452 --- /dev/null +++ b/nest-cli.json @@ -0,0 +1,83 @@ +{ + "monorepo": true, + "root": "apps/social-api", + "sourceRoot": "apps/social-api/src", + "compilerOptions": { + "webpack": true, + "tsConfigPath": "apps/social-api/tsconfig.app.json" + }, + "projects": { + "social-api": { + "type": "application", + "root": "apps/social-api", + "entryFile": "main", + "sourceRoot": "apps/social-api/src", + "compilerOptions": { + "tsConfigPath": "apps/social-api/tsconfig.app.json" + } + }, + "article": { + "type": "application", + "root": "apps/article", + "entryFile": "main", + "sourceRoot": "apps/article/src", + "compilerOptions": { + "tsConfigPath": "apps/article/tsconfig.app.json" + } + }, + "profile": { + "type": "application", + "root": "apps/profile", + "entryFile": "main", + "sourceRoot": "apps/profile/src", + "compilerOptions": { + "tsConfigPath": "apps/profile/tsconfig.app.json" + } + }, + "user": { + "type": "application", + "root": "apps/user", + "entryFile": "main", + "sourceRoot": "apps/user/src", + "compilerOptions": { + "tsConfigPath": "apps/user/tsconfig.app.json" + } + }, + "persistence": { + "type": "library", + "root": "libs/persistence", + "entryFile": "index", + "sourceRoot": "libs/persistence/src", + "compilerOptions": { + "tsConfigPath": "libs/persistence/tsconfig.lib.json" + } + }, + "redis": { + "type": "library", + "root": "libs/redis", + "entryFile": "index", + "sourceRoot": "libs/redis/src", + "compilerOptions": { + "tsConfigPath": "libs/redis/tsconfig.lib.json" + } + }, + "auth": { + "type": "library", + "root": "libs/auth", + "entryFile": "index", + "sourceRoot": "libs/auth/src", + "compilerOptions": { + "tsConfigPath": "libs/auth/tsconfig.lib.json" + } + }, + "media": { + "type": "application", + "root": "apps/media", + "entryFile": "main", + "sourceRoot": "apps/media/src", + "compilerOptions": { + "tsConfigPath": "apps/media/tsconfig.app.json" + } + } + } +} \ No newline at end of file diff --git a/package.json b/package.json index 270808a..5a7bc09 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "yarn clean && tsc --project tsconfig.json && tsc-alias -p tsconfig.json", "start": "node -r tsconfig-paths/register -r ts-node/register index.js ", "dev": "NODE_ENV=development nodemon -- --inspect", - "start:prod": "NODE_ENV=production node -r tsconfig-paths/register -r ts-node/register dist/main.js", + "start:prod": "node dist/apps/social-api/main", "test": "jest --config=jest.json", "test:watch": "jest --watch --config=jest.json", "test:coverage": "jest --config=jest.json --coverage --coverageDirectory=coverage", @@ -52,8 +52,8 @@ "rxjs": "^6.5.5", "slug": "^1.1.0", "swagger-ui-express": "^4.6.3", - "typeorm": "^0.2.24", - "typescript": "^5.1.3" + "typeorm": "^0.3.20", + "typescript": "^5.4.5" }, "devDependencies": { "@types/express": "^4.17.17", @@ -71,4 +71,4 @@ "tsc-alias": "^1.8.8", "tsconfig-paths": "^4.2.0" } -} +} \ No newline at end of file diff --git a/src/app.module.ts b/src/app.module.ts deleted file mode 100644 index c0774ea..0000000 --- a/src/app.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Module } from "@nestjs/common"; -import { ConfigModule } from "@nestjs/config"; -import { ScheduleModule } from "@nestjs/schedule"; - -import { InfrastructureModule } from "./infrastructure/infrastructure.module"; -import { - ArticleModule, - MediaModule, - ProfileModule, - TagModule, - UserModule, -} from "./modules"; - -@Module({ - imports: [ - ConfigModule.forRoot({ isGlobal: true }), - ScheduleModule.forRoot(), - ArticleModule, - MediaModule, - ProfileModule, - TagModule, - UserModule, - InfrastructureModule, - ], - controllers: [], - providers: [], -}) -export class ApplicationModule {} diff --git a/src/configs/index.ts b/src/configs/index.ts deleted file mode 100644 index d6190b8..0000000 --- a/src/configs/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const JWT_SECRET_KEY = process.env.JWT_SECRET_KEY; - -export const FORMAT_DATE = "YYYY-MM-DD"; diff --git a/src/infrastructure/infrastructure.module.ts b/src/infrastructure/infrastructure.module.ts deleted file mode 100644 index b830b7b..0000000 --- a/src/infrastructure/infrastructure.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Module } from "@nestjs/common"; -import { PersistenceModule } from "./persistence/persistence.module"; -import { RedisModule } from "./redis/redis.module"; - -@Module({ - imports: [PersistenceModule, RedisModule], -}) -export class InfrastructureModule {} diff --git a/src/infrastructure/persistence/README.md b/src/infrastructure/persistence/README.md deleted file mode 100644 index 04978bc..0000000 --- a/src/infrastructure/persistence/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Persistence Module - -## Overview - -The Database Module is responsible for managing the application's database interactions. It includes configuration, connection pooling, and schema definitions for the PostgreSQL database. - -## Architecture - -- **infrastructure:** Infrastructure contains the implementation detail of repository. -- **migrations:** Manages database migrations, facilitating schema changes and versioning. - -## Technologies and Libraries - -- NestJS -- TypeORM (or any other ORM used) -- PostgreSQL - -## Special Instructions - -- Use the `Migrations` section to handle database schema changes. Follow the migration guidelines for safe and consistent database updates. - -## Usage - -- Use ORM tools to interact with the database. -- Follow best practices for running migrations in different environments (development, staging, production). diff --git a/src/infrastructure/persistence/persistence.module.ts b/src/infrastructure/persistence/persistence.module.ts deleted file mode 100644 index a4c140d..0000000 --- a/src/infrastructure/persistence/persistence.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Module } from "@nestjs/common"; -import { TypeOrmModule } from "@nestjs/typeorm"; - -import { RepositoryModule } from "./repositories/repository.module"; - -@Module({ - imports: [TypeOrmModule.forRoot(), RepositoryModule], -}) -export class PersistenceModule {} diff --git a/src/main.ts b/src/main.ts deleted file mode 100644 index 37cb379..0000000 --- a/src/main.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { NestApplicationOptions } from "@nestjs/common"; -import { NestFactory } from "@nestjs/core"; -import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger"; -import * as cluster from "cluster"; -import { json, urlencoded } from "express"; -import * as os from "os"; - -import { ApplicationModule } from "./app.module"; - -async function bootstrap() { - if (cluster.isMaster) { - const numWorkers = os.cpus().length; - console.log(`Master cluster setting up ${numWorkers} workers...`); - - for (let i = 0; i < 1; i++) { - cluster.fork(); - } - - cluster.on("online", (worker) => { - console.log(`Worker ${worker.process.pid} is online`); - }); - - cluster.on("exit", (worker, code, signal) => { - console.log( - `Worker ${worker.process.pid} died with code: ${code}, and signal: ${signal}` - ); - console.log("Starting a new worker"); - cluster.fork(); - }); - } else { - const appOptions: NestApplicationOptions = { - cors: { - origin: [process.env.CORS_ORIGIN], - }, - }; - const app = await NestFactory.create(ApplicationModule, appOptions); - app.use(json({ limit: "50mb" })); - app.use(urlencoded({ extended: true, limit: "50mb" })); - app.setGlobalPrefix("api"); - - const options = new DocumentBuilder() - .setTitle("Social API") - .setDescription("The Boilerplate API description") - .setVersion("1.0") - .setBasePath("api") - .addBearerAuth() - .build(); - const document = SwaggerModule.createDocument(app, options); - SwaggerModule.setup("/docs", app, document); - - await app.listen(8000); - } -} -bootstrap(); diff --git a/src/modules/index.ts b/src/modules/index.ts deleted file mode 100644 index d5dddd5..0000000 --- a/src/modules/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ArticleModule } from "./article/article.module"; -import { MediaModule } from "./media/media.module"; -import { ProfileModule } from "./profile/profile.module"; -import { TagModule } from "./tag/tag.module"; -import { UserModule } from "./user/user.module"; - -export { ArticleModule, MediaModule, ProfileModule, TagModule, UserModule }; diff --git a/src/modules/tag/README.md b/src/modules/tag/README.md deleted file mode 100644 index 53d9160..0000000 --- a/src/modules/tag/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Tag Module - -## Overview - -The Tag Module is designed to manage tags within the application. It handles operations like creating, retrieving, and managing tags associated with other entities like articles. - -## Architecture - -- **Core:** Contains business logic related to tag management, including entities and interfaces. -- **Application:** Manages application-specific logic for tag operations. -- **Presentation:** Provides REST API endpoints for tag-related actions. - -## REST API Endpoints - -- `POST /tags`: Create a new tag. -- `GET /tags`: Retrieve all tags. -- `GET /tags/:id`: Retrieve a specific tag. - -## Technologies and Libraries - -- NestJS -- TypeScript -- PostgreSQL diff --git a/src/modules/tag/application/index.ts b/src/modules/tag/application/index.ts deleted file mode 100644 index 9827b21..0000000 --- a/src/modules/tag/application/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tag.service"; diff --git a/src/modules/tag/core/entities/index.ts b/src/modules/tag/core/entities/index.ts deleted file mode 100644 index 7acb7ad..0000000 --- a/src/modules/tag/core/entities/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tag.entity"; diff --git a/src/modules/tag/core/index.ts b/src/modules/tag/core/index.ts deleted file mode 100644 index 7fdb3d2..0000000 --- a/src/modules/tag/core/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./entities"; -export * from "./interfaces"; -export * from "./ports"; -export * from "./token"; diff --git a/src/modules/tag/core/interfaces/index.ts b/src/modules/tag/core/interfaces/index.ts deleted file mode 100644 index b42c718..0000000 --- a/src/modules/tag/core/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tag.interface"; diff --git a/src/modules/tag/core/ports/index.ts b/src/modules/tag/core/ports/index.ts deleted file mode 100644 index e44ad69..0000000 --- a/src/modules/tag/core/ports/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tag.port"; diff --git a/src/modules/tag/core/token/index.ts b/src/modules/tag/core/token/index.ts deleted file mode 100644 index 8d2e4b5..0000000 --- a/src/modules/tag/core/token/index.ts +++ /dev/null @@ -1 +0,0 @@ -export const TAG_REPOSITORY = "TAG_REPOSITORY"; diff --git a/src/modules/tag/presentation/index.ts b/src/modules/tag/presentation/index.ts deleted file mode 100644 index 3e472e3..0000000 --- a/src/modules/tag/presentation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tag.controller"; diff --git a/src/modules/tag/tag.module.ts b/src/modules/tag/tag.module.ts deleted file mode 100644 index 2128c97..0000000 --- a/src/modules/tag/tag.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common"; -import { UserModule } from "../user/user.module"; -import { TagService } from "./application"; -import { TagController } from "./presentation"; - -@Module({ - imports: [UserModule], - providers: [TagService], - controllers: [TagController], - exports: [], -}) -export class TagModule implements NestModule { - public configure(consumer: MiddlewareConsumer) {} -} diff --git a/src/shared/base.controller.ts b/src/shared/base.controller.ts deleted file mode 100644 index c8db17d..0000000 --- a/src/shared/base.controller.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as jwt from "jsonwebtoken"; -import { JWT_SECRET_KEY } from "../configs"; - -export class BaseController { - constructor() {} - - protected getUserIdFromToken(authorization) { - if (!authorization) return null; - - const token = authorization.split(" ")[1]; - const decoded: any = jwt.verify(token, JWT_SECRET_KEY); - return decoded.id; - } -} diff --git a/src/shared/middleware/auth.middleware.ts b/src/shared/middleware/auth.middleware.ts deleted file mode 100644 index 6cce7be..0000000 --- a/src/shared/middleware/auth.middleware.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { HttpStatus, Injectable, NestMiddleware } from "@nestjs/common"; -import { HttpException } from "@nestjs/common/exceptions/http.exception"; -import { QueryBus } from "@nestjs/cqrs"; -import { NextFunction, Request, Response } from "express"; -import { IncomingHttpHeaders } from "http"; -import * as jwt from "jsonwebtoken"; - -import { JWT_SECRET_KEY } from "@configs"; -import { RedisService } from "@redis/redis.service"; -import { FindUserById } from "@user/application/queries"; -import { UserData } from "@user/core/interfaces"; - -interface IRequestCustom extends Request { - user: UserData; - headers: IncomingHttpHeaders; -} - -@Injectable() -export class AuthMiddleware implements NestMiddleware { - constructor( - private readonly queryBus: QueryBus, - private readonly redisCacheService: RedisService - ) {} - - async use(req: IRequestCustom, res: Response, next: NextFunction) { - const authHeaders = req.headers.authorization; - if (authHeaders && (authHeaders as string).split(" ")[1]) { - const token = (authHeaders as string).split(" ")[1]; - const decoded: any = jwt.verify(token, JWT_SECRET_KEY); - - const _user = await this.redisCacheService.get(decoded.id); - if (_user) { - req.user = _user; - return next(); - } - - const user = await this.queryBus.execute(new FindUserById(decoded.id)); - - if (!user) { - throw new HttpException("User not found.", HttpStatus.UNAUTHORIZED); - } - - req.user = user.user; - next(); - } else { - throw new HttpException("Not authorized.", HttpStatus.UNAUTHORIZED); - } - } -} diff --git a/src/shared/middleware/index.ts b/src/shared/middleware/index.ts deleted file mode 100644 index 62b4a3a..0000000 --- a/src/shared/middleware/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./auth.middleware"; -export * from "./user.decorator"; diff --git a/src/shared/middleware/user.decorator.ts b/src/shared/middleware/user.decorator.ts deleted file mode 100644 index 18ea9b6..0000000 --- a/src/shared/middleware/user.decorator.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { createParamDecorator, ExecutionContext } from "@nestjs/common"; -import * as jwt from "jsonwebtoken"; - -import { JWT_SECRET_KEY } from "../../configs"; -import { CurrentUser } from "../../modules/user/core/interfaces/user.interface"; - -export const User = createParamDecorator((data: any, ctx: ExecutionContext) => { - const req = ctx.switchToHttp().getRequest(); - // if route is protected, there is a user set in auth.middleware - if (!!req.user) { - return !!data ? req.user[data] : req.user; - } - - // in case a route is not protected, we still want to get the optional auth user from jwt - const token = req.headers.authorization - ? (req.headers.authorization as string).split(" ") - : null; - if (token && token[1]) { - const decoded: CurrentUser = jwt.verify(token[1], JWT_SECRET_KEY); - return !!data ? decoded[data] : decoded; - } -}); diff --git a/src/shared/pipes/validation.pipe.ts b/src/shared/pipes/validation.pipe.ts deleted file mode 100644 index 7c9b0e8..0000000 --- a/src/shared/pipes/validation.pipe.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - PipeTransform, - ArgumentMetadata, - BadRequestException, - HttpStatus, - Injectable, -} from "@nestjs/common"; -import { validate } from "class-validator"; -import { plainToClass } from "class-transformer"; -import { HttpException } from "@nestjs/common/exceptions/http.exception"; - -@Injectable() -export class ValidationPipe implements PipeTransform { - async transform(value: any, metadata: ArgumentMetadata) { - if (!value) { - throw new BadRequestException("No data submitted"); - } - - const { metatype } = metadata; - if (!metatype || !this.toValidate(metatype)) { - return value; - } - const object = plainToClass(metatype, value); - const errors = await validate(object); - if (errors.length > 0) { - throw new HttpException( - { - message: "Input data validation failed", - errors: this.buildError(errors), - }, - HttpStatus.BAD_REQUEST - ); - } - return value; - } - - private buildError(errors) { - const result = {}; - errors.forEach((el) => { - let prop = el.property; - Object.entries(el.constraints).forEach((constraint) => { - result[prop + constraint[0]] = `${constraint[1]}`; - }); - }); - return result; - } - - private toValidate(metatype): boolean { - const types = [String, Boolean, Number, Array, Object]; - return !types.find((type) => metatype === type); - } -} diff --git a/tsconfig.json b/tsconfig.json index 8af607f..eb1ae6d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,40 @@ { "compilerOptions": { "module": "commonjs", - "declaration": false, - "noImplicitAny": false, + "declaration": true, "removeComments": true, - "noLib": false, - "lib": ["es2017"], "emitDecoratorMetadata": true, "experimentalDecorators": true, - "target": "es6", + "allowSyntheticDefaultImports": true, + "target": "ES2021", "sourceMap": true, - "allowJs": true, "outDir": "./dist", "baseUrl": "./", + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false, "paths": { - "@article/*": ["src/modules/article/*"], - "@configs": ["src/configs/index"], - "@media/*": ["src/modules/media/*"], - "@profile/*": ["src/modules/profile/*"], - "@tag/*": ["src/modules/tag/*"], - "@user/*": ["src/modules/user/*"], - "@rabbitmq/*": ["src/infrastructure/rabbitmq/*"], - "@redis/*": ["src/infrastructure/redis/*"], - "@shared/*": ["src/shared/*"] + "@app/persistence": [ + "libs/persistence/src" + ], + "@app/persistence/*": [ + "libs/persistence/src/*" + ], + "@app/redis": [ + "libs/redis/src" + ], + "@app/redis/*": [ + "libs/redis/src/*" + ], + "@app/auth": [ + "libs/auth/src" + ], + "@app/auth/*": [ + "libs/auth/src/*" + ] } - }, - "include": ["src/**/*", "dist/**/*"], - "exclude": ["node_modules", "**/*.spec.ts"] -} + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a9087de..ecfbc18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -289,6 +289,18 @@ resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -638,6 +650,11 @@ dependencies: safe-buffer "^5.1.2" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -645,7 +662,7 @@ dependencies: type-detect "4.0.8" -"@sqltools/formatter@^1.2.2": +"@sqltools/formatter@^1.2.5": version "1.2.5" resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.5.tgz#3abc203c79b8c3e90fd6c156a0c62d5403520e12" integrity sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw== @@ -843,11 +860,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/zen-observable@0.8.3": - version "0.8.3" - resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.3.tgz#781d360c282436494b32fe7d9f7f8e64b3118aa3" - integrity sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw== - abab@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" @@ -933,6 +945,11 @@ ansi-regex@^5.0.0, ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -947,6 +964,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + any-promise@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -968,7 +990,7 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -app-root-path@^3.0.0: +app-root-path@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86" integrity sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA== @@ -1012,11 +1034,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -1270,6 +1287,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^2.3.1, braces@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -1451,7 +1475,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1845,6 +1869,11 @@ data-urls@^1.1.0: whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" +dayjs@^1.11.9: + version "1.11.11" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.11.tgz#dfe0e9d54c5f8b68ccf8ca5f72ac603e7e5ed59e" + integrity sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg== + debug@2.6.9, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1859,7 +1888,7 @@ debug@^3.1.0, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -2002,11 +2031,6 @@ dotenv@^16.0.3: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== -dotenv@^8.2.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" - integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== - dropbox@^10.34.0: version "10.34.0" resolved "https://registry.yarnpkg.com/dropbox/-/dropbox-10.34.0.tgz#a4b17dad4c320855fe45b5b9786a8aaf869c3ade" @@ -2027,6 +2051,11 @@ duration@^0.2.2: d "1" es5-ext "~0.10.46" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -2057,6 +2086,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -2436,6 +2470,14 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -2609,7 +2651,18 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^10.3.10: + version "10.3.12" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.12.tgz#3a65c363c2e9998d220338e88a5f6ac97302960b" + integrity sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.6" + minimatch "^9.0.1" + minipass "^7.0.4" + path-scurry "^1.10.2" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3265,6 +3318,15 @@ iterare@1.2.1: resolved "https://registry.yarnpkg.com/iterare/-/iterare-1.2.1.tgz#139c400ff7363690e33abffa33cbba8920f00042" integrity sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q== +jackspeak@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.5.0.tgz#141cc23567ceb3f534526f8614ba39421383634c" @@ -3647,13 +3709,6 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -3930,6 +3985,11 @@ lowercase-keys@^1.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== +lru-cache@^10.2.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" + integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -4069,6 +4129,13 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.1: + version "9.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" + integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.6: version "1.2.7" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" @@ -4082,6 +4149,11 @@ minipass@^2.6.0, minipass@^2.9.0: safe-buffer "^5.1.2" yallist "^3.0.0" +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" + integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== + minizlib@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" @@ -4109,10 +4181,10 @@ mkdirp@0.x, mkdirp@^0.5.1, mkdirp@^0.5.5: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.3.tgz#b083ff37be046fd3d6552468c1f0ff44c1545d1f" integrity sha512-sjAkg21peAG9HS+Dkx7hlG9Ztx7HLeKnvB3NQRcu/mltCVmvkF0pisbiTSfDVYTT86XEfZrTUosLdZLStquZUw== -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^2.1.3: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" + integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== moment@^2.30.1: version "2.30.1" @@ -4620,6 +4692,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.2.tgz#8f6357eb1239d5fa1da8b9f70e9c080675458ba7" + integrity sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -4980,6 +5060,11 @@ reflect-metadata@^0.1.13: resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +reflect-metadata@^0.2.1: + version "0.2.2" + resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.2.2.tgz#400c845b6cba87a21f2c65c4aeb158f4fa4d9c5b" + integrity sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q== + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -5322,6 +5407,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -5516,6 +5606,15 @@ string-length@^3.1.0: astral-regex "^1.0.0" strip-ansi "^5.2.0" +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -5525,15 +5624,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -5542,6 +5632,15 @@ string-width@^2.0.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -5554,6 +5653,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -5575,12 +5681,12 @@ strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: - ansi-regex "^5.0.1" + ansi-regex "^6.0.1" strip-bom@^3.0.0: version "3.0.0" @@ -5877,10 +5983,10 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" - integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== +tslib@^2.5.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== tunnel-agent@^0.6.0: version "0.6.0" @@ -5951,33 +6057,31 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typeorm@^0.2.24: - version "0.2.45" - resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.45.tgz#e5bbb3af822dc4646bad96cfa48cd22fa4687cea" - integrity sha512-c0rCO8VMJ3ER7JQ73xfk0zDnVv0WDjpsP6Q1m6CVKul7DB9iVdWLRjPzc8v2eaeBuomsbZ2+gTaYr8k1gm3bYA== +typeorm@^0.3.20: + version "0.3.20" + resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.3.20.tgz#4b61d737c6fed4e9f63006f88d58a5e54816b7ab" + integrity sha512-sJ0T08dV5eoZroaq9uPKBoNcGslHBR4E4y+EBHs//SiGbblGe7IeduP/IH4ddCcj0qp3PHwDwGnuvqEAnKlq/Q== dependencies: - "@sqltools/formatter" "^1.2.2" - app-root-path "^3.0.0" + "@sqltools/formatter" "^1.2.5" + app-root-path "^3.1.0" buffer "^6.0.3" - chalk "^4.1.0" + chalk "^4.1.2" cli-highlight "^2.1.11" - debug "^4.3.1" - dotenv "^8.2.0" - glob "^7.1.6" - js-yaml "^4.0.0" - mkdirp "^1.0.4" - reflect-metadata "^0.1.13" + dayjs "^1.11.9" + debug "^4.3.4" + dotenv "^16.0.3" + glob "^10.3.10" + mkdirp "^2.1.3" + reflect-metadata "^0.2.1" sha.js "^2.4.11" - tslib "^2.1.0" - uuid "^8.3.2" - xml2js "^0.4.23" - yargs "^17.0.1" - zen-observable-ts "^1.0.0" + tslib "^2.5.0" + uuid "^9.0.0" + yargs "^17.6.2" -typescript@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" - integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== +typescript@^5.4.5: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== undefsafe@^2.0.2: version "2.0.5" @@ -6123,12 +6227,12 @@ uuid@8.3.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== -uuid@8.3.2, uuid@^8.3.2: +uuid@8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@9.0.1: +uuid@9.0.1, uuid@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== @@ -6286,6 +6390,15 @@ word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -6295,14 +6408,14 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" wrappy@1: version "1.0.2" @@ -6351,19 +6464,6 @@ xml2js@0.4.19: sax ">=0.6.0" xmlbuilder "~9.0.1" -xml2js@^0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xmlbuilder@~11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" - integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== - xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" @@ -6452,10 +6552,10 @@ yargs@^16.0.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.1: - version "17.6.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" - integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== +yargs@^17.6.2: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" escalade "^3.1.1" @@ -6469,16 +6569,3 @@ yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -zen-observable-ts@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.1.0.tgz#2d1aa9d79b87058e9b75698b92791c1838551f83" - integrity sha512-1h4zlLSqI2cRLPJUHJFL8bCWHhkpuXkF+dbGkRaWjgDIG26DmzyshUMrdV/rL3UnR+mhaX4fRq8LPouq0MYYIA== - dependencies: - "@types/zen-observable" "0.8.3" - zen-observable "0.8.15" - -zen-observable@0.8.15: - version "0.8.15" - resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" - integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==