update dependencies, attempt to fix server restart issue

This commit is contained in:
Amruth Pillai
2023-04-20 22:33:11 +02:00
parent ed710f6fe5
commit 036b2917a6
12 changed files with 1588 additions and 1243 deletions

View File

@ -1,5 +1,19 @@
{
"extends": "../.eslintrc.json",
"plugins": ["unused-imports"],
"ignorePatterns": ["dist"],
"env": { "node": true }
"env": { "node": true },
"rules": {
// Unused Imports
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "none",
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_"
}
]
}
}

View File

@ -8,8 +8,9 @@
"start": "node dist/main"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.306.0",
"@aws-sdk/client-s3": "^3.317.0",
"@nestjs/axios": "^2.0.0",
"@nestjs/cache-manager": "^1.0.0",
"@nestjs/common": "^9.4.0",
"@nestjs/config": "^2.3.1",
"@nestjs/core": "^9.4.0",
@ -41,33 +42,34 @@
"passport-local": "^1.0.0",
"pdf-lib": "^1.17.1",
"pg": "^8.10.0",
"playwright-chromium": "^1.32.2",
"playwright-chromium": "^1.32.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"rimraf": "^5.0.0",
"rxjs": "^7.8.0",
"typeorm": "0.3.13",
"typeorm": "0.3.15",
"uuid": "^9.0.0"
},
"devDependencies": {
"@nestjs/cli": "^9.3.0",
"@nestjs/cli": "^9.4.0",
"@nestjs/schematics": "^9.1.0",
"@reactive-resume/schema": "workspace:*",
"@types/bcryptjs": "^2.4.2",
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.17",
"@types/lodash": "^4.14.192",
"@types/lodash": "^4.14.194",
"@types/multer": "^1.4.7",
"@types/node": "^18.15.11",
"@types/node": "^18.15.12",
"@types/nodemailer": "^6.4.7",
"@types/passport-jwt": "^3.0.8",
"@types/passport-local": "^1.0.35",
"@types/uuid": "^9.0.1",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "^2.8.7",
"source-map-support": "^0.5.21",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.3",
"webpack": "^5.78.0"
"typescript": "^5.0.4",
"webpack": "^5.80.0"
}
}

View File

@ -6,7 +6,6 @@ import { compareSync, hashSync } from 'bcryptjs';
import { OAuth2Client } from 'google-auth-library';
import { PostgresErrorCode } from '@/database/errorCodes.enum';
import { ResumeService } from '@/resume/resume.service';
import { CreateGoogleUserDto } from '@/users/dto/create-google-user.dto';
import { User } from '@/users/entities/user.entity';
import { UsersService } from '@/users/users.service';

View File

@ -1,4 +1,4 @@
import { IsNotEmpty, IsString, MinLength } from 'class-validator';
import { IsNotEmpty, IsString } from 'class-validator';
export class UpdateProfileDto {
@IsString()

View File

@ -1,5 +1,6 @@
import { HttpModule } from '@nestjs/axios';
import { CacheModule, Module } from '@nestjs/common';
import { CacheModule } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { FontsController } from './fonts.controller';

View File

@ -1,5 +1,5 @@
import { Controller, Get } from '@nestjs/common';
import { HealthCheck, HealthCheckService, HttpHealthIndicator, TypeOrmHealthIndicator } from '@nestjs/terminus';
import { HealthCheck, HealthCheckService, TypeOrmHealthIndicator } from '@nestjs/terminus';
@Controller('health')
export class HealthController {

View File

@ -1,4 +1,4 @@
import { Controller, Get, InternalServerErrorException, Param, Query } from '@nestjs/common';
import { Controller, Get, Param, Query } from '@nestjs/common';
import { PrinterService } from './printer.service';

View File

@ -252,10 +252,10 @@ export class ResumeService {
const publicUrl = urlPrefix + key;
await this.s3Client.send(
new PutObjectCommand({
Bucket: this.configService.get<string>('storage.bucket'),
Key: key,
Body: file.buffer,
ACL: 'public-read',
Bucket: this.configService.get<string>('storage.bucket'),
})
);
updatedResume = set(resume, 'basics.photo.url', publicUrl);
@ -283,14 +283,15 @@ export class ResumeService {
const resume = await this.findOne(id, userId);
const publicUrl = resume.basics.photo.url;
if (!publicUrl || publicUrl === '') return;
if (this.s3Enabled) {
const urlPrefix = this.configService.get<string>('storage.urlPrefix');
const key = publicUrl.replace(urlPrefix, '');
await this.s3Client.send(
new DeleteObjectCommand({
Bucket: this.configService.get<string>('storage.bucket'),
Key: key,
Bucket: this.configService.get<string>('storage.bucket'),
})
);
} else {
@ -299,9 +300,7 @@ export class ResumeService {
const isValidFile = (await fs.stat(filePath)).isFile();
if (isValidFile) {
await fs.unlink(filePath);
}
if (isValidFile) await fs.unlink(filePath);
}
const updatedResume = set(resume, 'basics.photo.url', '');