feat(dependencies): ⬆️ update dependencies, fix date display issue, add more profile icons

This commit is contained in:
Amruth Pillai
2023-01-03 17:06:30 +01:00
parent 3b4ea00db8
commit 63084eebb4
20 changed files with 2006 additions and 779 deletions

View File

@ -15,7 +15,6 @@ import {
} from '@reactive-resume/schema';
import csv from 'csvtojson';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import { readFile, unlink } from 'fs/promises';
import { cloneDeep, get, isEmpty, merge } from 'lodash';
import StreamZip from 'node-stream-zip';
@ -29,9 +28,7 @@ import { ResumeService } from '@/resume/resume.service';
@Injectable()
export class IntegrationsService {
constructor(private resumeService: ResumeService) {
dayjs.extend(utc);
}
constructor(private resumeService: ResumeService) {}
async linkedIn(userId: number, path: string): Promise<ResumeEntity> {
let archive: StreamZip.StreamZipAsync;
@ -43,7 +40,7 @@ export class IntegrationsService {
const resume: Partial<Resume> = cloneDeep(defaultState);
// Basics
const timestamp = dayjs().utc().format(FILENAME_TIMESTAMP);
const timestamp = dayjs().format(FILENAME_TIMESTAMP);
merge<Partial<Resume>, DeepPartial<Resume>>(resume, {
name: `Imported from LinkedIn (${timestamp})`,
slug: `imported-from-linkedin-${timestamp}`,
@ -276,7 +273,7 @@ export class IntegrationsService {
const resume: Partial<Resume> = cloneDeep(defaultState);
// Metadata
const timestamp = dayjs().utc().format(FILENAME_TIMESTAMP);
const timestamp = dayjs().format(FILENAME_TIMESTAMP);
merge<Partial<Resume>, DeepPartial<Resume>>(resume, {
name: `Imported from JSON Resume (${timestamp})`,
slug: `imported-from-json-resume-${timestamp}`,
@ -611,7 +608,7 @@ export class IntegrationsService {
const resume: Partial<Resume> = cloneDeep(jsonResume);
// Metadata
const timestamp = dayjs().utc().format(FILENAME_TIMESTAMP);
const timestamp = dayjs().format(FILENAME_TIMESTAMP);
merge<Partial<Resume>, DeepPartial<Resume>>(resume, {
name: `Imported from Reactive Resume (${timestamp})`,
slug: `imported-from-reactive-resume-${timestamp}`,
@ -632,7 +629,7 @@ export class IntegrationsService {
const resume: Partial<Resume> = cloneDeep(defaultState);
// Metadata
const timestamp = dayjs().utc().format(FILENAME_TIMESTAMP);
const timestamp = dayjs().format(FILENAME_TIMESTAMP);
merge<Partial<Resume>, DeepPartial<Resume>>(resume, {
name: `Imported from Reactive Resume V2 (${timestamp})`,
slug: `imported-from-reactive-resume-v2-${timestamp}`,
@ -958,6 +955,6 @@ export class IntegrationsService {
}
private parseDate = (date: string): string => {
return isEmpty(date) ? '' : dayjs(date).utc().toISOString();
return isEmpty(date) ? '' : dayjs(date).toISOString();
};
}

View File

@ -31,10 +31,8 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy {
const publicUrl = `${serverUrl}/assets/exports/${filename}`;
try {
// check if file already exists
await access(join(directory, filename));
} catch {
// delete old files and scheduler jobs
const activeSchedulerTimeouts = this.schedulerRegistry.getTimeouts();
await readdir(directory).then(async (files) => {
await Promise.all(
@ -49,7 +47,6 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy {
);
});
// create file as it doesn't exist
const url = this.configService.get<string>('app.url');
const secretKey = this.configService.get<string>('app.secretKey');
const pdfDeletionTime = this.configService.get<number>('cache.pdfDeletionTime');
@ -57,8 +54,8 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy {
const page = await this.browser.newPage();
await page.goto(`${url}/${username}/${slug}/printer?secretKey=${secretKey}`);
await page.waitForLoadState('networkidle');
await page.waitForSelector('html.wf-active');
await page.waitForLoadState("networkidle")
const pageFormat: PageConfig['format'] = await page.$$eval(
'[data-page]',

View File

@ -5,9 +5,9 @@ const sampleData: Partial<Resume> = {
name: 'Alexis Jones',
email: 'alexis.jones@gmail.com',
phone: '+1 800 1200 3820',
birthdate: '1995-08-06T00:00:00.000Z',
birthdate: '1995-08-06',
photo: {
url: `/images/sample-photo.jpg`,
url: `https://i.imgur.com/40gTnCx.jpg`,
filters: {
size: 128,
shape: 'rounded-square',
@ -53,7 +53,7 @@ const sampleData: Partial<Resume> = {
url: 'https://www.espritcam.com',
date: {
end: '',
start: '2015-09-01T16:34:27.000Z',
start: '2015-09-01',
},
name: 'DP Technology Corp.',
summary:
@ -64,8 +64,8 @@ const sampleData: Partial<Resume> = {
id: '285d78f8-df56-4569-ba6b-cff5ebe5381e',
url: 'https://www.vokophone.com',
date: {
end: '2015-07-31T22:00:00.000Z',
start: '2011-05-31T22:00:00.000Z',
end: '2015-07-31',
start: '2011-05-31',
},
name: 'Voko Communications',
summary:
@ -84,7 +84,7 @@ const sampleData: Partial<Resume> = {
{
title: 'Blitz Hackathon',
awarder: '2nd Place',
date: '2018-03-31T22:00:00.000Z',
date: '2018-03-31',
url: '',
summary: '',
id: '657cadb0-c07d-4a35-8351-9079598c7ac0',
@ -92,7 +92,7 @@ const sampleData: Partial<Resume> = {
{
title: 'Carl-Zeiss Hackathon',
awarder: '2nd Place',
date: '2017-05-09T22:00:00.000Z',
date: '2017-05-09',
url: '',
summary: '',
id: 'db3bc5cb-483e-4221-9867-9c28ee5f2051',