diff --git a/.history/api/src/app.module_20220722121129.ts b/.history/api/src/app.module_20220722121129.ts new file mode 100644 index 000000000..cc06ec721 --- /dev/null +++ b/.history/api/src/app.module_20220722121129.ts @@ -0,0 +1,49 @@ +import { AppService } from './app.service'; +import { Module } from '@nestjs/common'; +import { PrismaService } from './prisma.service'; +import { JsTLService } from 'src/engines/jstl/jstl.service'; +import { TemplateService } from './core/template/template.service'; +import { AuditService } from './core/audit/audit.service'; +import { LambdaService } from './core/lambda/lambda.service'; +import { LambdaController } from './core/lambda/lambda.controller'; +import { TransformerService } from './core/transformer/transformer.service'; +import { TransformerController } from './core/transformer/transformer.controller'; +import { TemplateController } from './core/template/template.controller'; +import { JinjaService } from './engines/jinja/jinja.service'; +import { EjsService } from './engines/ejs/ejs.service'; +import { VMService } from './core/lambda/vm.service'; +import { SingletonServiceModule } from './singletonService.module'; +import { I18nController } from './core/i18n/i18n/i18n.controller'; +<<<<<<< HEAD +======= +import { SearchController } from './core/search/search.controller'; +>>>>>>> 3296e6186e13dc977ad9c926a00ee301aac12522 + +@Module({ + imports: [SingletonServiceModule], + controllers: [ + LambdaController, + TransformerController, + TemplateController, + LambdaService, + I18nController, +<<<<<<< HEAD +======= + SearchController, +>>>>>>> 3296e6186e13dc977ad9c926a00ee301aac12522 + ], + exports: [VMService], + providers: [ + AppService, + PrismaService, + JsTLService, + TemplateService, + AuditService, + LambdaService, + TransformerService, + JinjaService, + EjsService, + VMService, + ], +}) +export class AppModule {} diff --git a/.history/api/src/app.module_20220722121256.ts b/.history/api/src/app.module_20220722121256.ts new file mode 100644 index 000000000..1d981051a --- /dev/null +++ b/.history/api/src/app.module_20220722121256.ts @@ -0,0 +1,43 @@ +import { AppService } from './app.service'; +import { Module } from '@nestjs/common'; +import { PrismaService } from './prisma.service'; +import { JsTLService } from 'src/engines/jstl/jstl.service'; +import { TemplateService } from './core/template/template.service'; +import { AuditService } from './core/audit/audit.service'; +import { LambdaService } from './core/lambda/lambda.service'; +import { LambdaController } from './core/lambda/lambda.controller'; +import { TransformerService } from './core/transformer/transformer.service'; +import { TransformerController } from './core/transformer/transformer.controller'; +import { TemplateController } from './core/template/template.controller'; +import { JinjaService } from './engines/jinja/jinja.service'; +import { EjsService } from './engines/ejs/ejs.service'; +import { VMService } from './core/lambda/vm.service'; +import { SingletonServiceModule } from './singletonService.module'; +import { I18nController } from './core/i18n/i18n/i18n.controller'; +import { SearchController } from './core/search/search.controller'; + +@Module({ + imports: [SingletonServiceModule], + controllers: [ + LambdaController, + TransformerController, + TemplateController, + LambdaService, + I18nController, + SearchController, + ], + exports: [VMService], + providers: [ + AppService, + PrismaService, + JsTLService, + TemplateService, + AuditService, + LambdaService, + TransformerService, + JinjaService, + EjsService, + VMService, + ], +}) +export class AppModule {} diff --git a/.history/api/src/core/i18n/i18n/i18n.controller_20220722115508.ts b/.history/api/src/core/i18n/i18n/i18n.controller_20220722115508.ts new file mode 100644 index 000000000..b35c26ecb --- /dev/null +++ b/.history/api/src/core/i18n/i18n/i18n.controller_20220722115508.ts @@ -0,0 +1,163 @@ +import { + BadRequestException, + Body, + Controller, + Delete, + Get, + Param, + Post, +} from '@nestjs/common'; +import { Template, TemplateType, Prisma } from '@prisma/client'; +import { PrismaService } from '../../../prisma.service'; +import { TransformerService } from '../../transformer/transformer.service'; +import { RenderDto, RenderDtoTest, RenderResponse } from '../../dto/render'; +import { JsTLService } from 'src/engines/jstl/jstl.service'; +import { TemplateService } from '../../template/template.service'; +import { JinjaService } from 'src/engines/jinja/jinja.service'; +import { EjsService } from 'src/engines/ejs/ejs.service'; + +@Controller('i18n') +export class I18nController { + constructor( + private readonly jinjaService: JinjaService, + private readonly ejsService: EjsService, + private readonly prisma: PrismaService, + private readonly transformerService: TransformerService, + private readonly templateService: TemplateService, + private readonly jstlService: JsTLService, + ) {} + + @Post() + async addTemplate( + @Body() templateData: Prisma.TemplateCreateInput, + ): Promise