Skip to content

Commit

Permalink
chore(): update to 0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-Preap committed May 26, 2021
1 parent 74861c0 commit 92e7d3c
Show file tree
Hide file tree
Showing 18 changed files with 1,565 additions and 1,667 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:import/errors',
'plugin:import/typescript',
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 0.12.1

_*May 26, 2021*_

- update dependencies in `package.json`
- update [breaking changes](https://github.com/mdevils/html-entities/blob/master/CHANGELOG.md#200) on `html-entities`
- update [breaking changes](https://github.com/typestack/class-transformer/blob/develop/CHANGELOG.md#032-breaking-change---2021-01-14) on `class-transform`
- update [breaking changes](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21) on `eslint-config-prettier`

## 0.12.0

_*Mar 27, 2021*_
Expand All @@ -15,7 +24,7 @@ _*Mar 27, 2021*_
- update prefix `Model` to model class in `@models`
- update sequelize controller
- update SQL example files in `@queries`
- update plopfile on `sequelize` and `typeorm`
- update plopfile on `sequelize` and `typeorm`
- remove `ToArrayCreateLang`, `ToArrayUpdateLang` in `@lib/sequelize`
- remove `sequelize.interfaces.ts` in `@lib/sequelize`
- remove unnecessary functions in `user.model.ts`
Expand Down
139 changes: 70 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backend-core-project",
"description": "backend-core-project description",
"version": "0.12.0",
"version": "0.12.1",
"private": true,
"engines": {
"node": ">= 12.13.0"
Expand Down Expand Up @@ -39,121 +39,122 @@
"dependencies": {
"@aws/dynamodb-data-mapper": "0.7.3",
"@aws/dynamodb-data-mapper-annotations": "0.7.3",
"@google-cloud/storage": "5.7.0",
"@nestjs/common": "7.6.13",
"@google-cloud/storage": "5.8.5",
"@nestjs/common": "7.6.15",
"@nestjs/config": "0.6.3",
"@nestjs/core": "7.6.13",
"@nestjs/core": "7.6.15",
"@nestjs/jwt": "7.2.0",
"@nestjs/passport": "7.1.5",
"@nestjs/platform-express": "7.6.13",
"@nestjs/platform-socket.io": "7.6.13",
"@nestjs/schedule": "0.4.2",
"@nestjs/sequelize": "^0.2.0",
"@nestjs/swagger": "4.7.15",
"@nestjs/platform-express": "7.6.15",
"@nestjs/platform-socket.io": "7.6.15",
"@nestjs/schedule": "0.4.3",
"@nestjs/sequelize": "0.2.0",
"@nestjs/swagger": "4.8.0",
"@nestjs/typeorm": "7.1.5",
"@nestjs/websockets": "7.6.13",
"@typegoose/typegoose": "7.4.5",
"archiver": "5.1.0",
"auth0": "2.31.0",
"aws-sdk": "2.817.0",
"@nestjs/websockets": "7.6.15",
"@typegoose/typegoose": "7.6.0",
"archiver": "5.3.0",
"auth0": "2.34.2",
"aws-sdk": "2.904.0",
"bcryptjs": "2.4.3",
"cache-manager": "3.4.0",
"cache-manager": "3.4.3",
"callsites": "3.1.0",
"class-transformer": "0.3.1",
"class-validator": "0.12.2",
"class-transformer": "0.4.0",
"class-validator": "0.13.1",
"compression": "1.7.4",
"cross-env": "7.0.3",
"debug": "4.3.1",
"exceljs": "4.2.0",
"firebase-admin": "9.4.2",
"form-data": "3.0.0",
"google-auth-library": "6.1.3",
"exceljs": "4.2.1",
"firebase-admin": "9.8.0",
"form-data": "4.0.0",
"google-auth-library": "7.0.4",
"graphql-request": "3.4.0",
"helmet": "4.2.0",
"html-entities": "1.4.0",
"i18next": "19.8.4",
"helmet": "4.6.0",
"html-entities": "2.3.2",
"i18next": "20.2.2",
"i18next-express-middleware": "2.0.0",
"i18next-node-fs-backend": "2.1.3",
"ioredis": "4.19.4",
"jwks-rsa": "1.12.0",
"keycloak-admin": "1.14.4",
"libphonenumber-js": "1.9.6",
"lodash": "4.17.20",
"mime-types": "2.1.27",
"ioredis": "4.27.2",
"jwks-rsa": "2.0.3",
"keycloak-admin": "1.14.16",
"libphonenumber-js": "1.9.17",
"lodash": "4.17.21",
"mime-types": "2.1.30",
"moment": "2.29.1",
"moment-range": "4.0.2",
"moment-timezone": "0.5.32",
"moment-timezone": "0.5.33",
"mongoose": "5.10.18",
"morgan": "1.10.0",
"mysql2": "2.2.5",
"node-media-server": "2.2.4",
"nodemailer": "6.4.17",
"openid-client": "4.2.2",
"node-media-server": "2.2.5",
"nodemailer": "6.6.0",
"openid-client": "4.7.3",
"passport": "0.4.1",
"passport-jwt": "4.0.0",
"pdfmake": "0.1.68",
"pug": "3.0.1",
"pdfmake": "0.1.71",
"pug": "3.0.2",
"randomatic": "3.1.1",
"reflect-metadata": "0.1.13",
"rxjs": "6.6.3",
"sanitize-html": "2.3.0",
"sequelize": "6.5.0",
"sanitize-html": "2.3.3",
"sequelize": "6.6.2",
"sequelize-typescript": "2.1.0",
"sharp": "0.27.0",
"sharp": "0.28.2",
"shelljs": "0.8.4",
"soap": "0.35.0",
"socket.io-redis": "6.0.1",
"soap": "0.37.0",
"socket.io-redis": "6.1.0",
"string-template": "1.0.0",
"swagger-ui-express": "4.1.6",
"twilio": "3.54.1",
"twilio": "3.62.0",
"twitter": "1.7.1",
"typeorm": "0.2.29"
"typeorm": "0.2.32"
},
"devDependencies": {
"@commitlint/cli": "11.0.0",
"@commitlint/config-angular": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@nestjs/cli": "7.5.6",
"@nestjs/testing": "7.6.13",
"@nestjs/cli": "7.6.0",
"@nestjs/testing": "7.6.15",
"@types/archiver": "5.1.0",
"@types/auth0": "2.20.12",
"@types/auth0": "2.33.3",
"@types/bcryptjs": "2.4.2",
"@types/compression": "1.7.0",
"@types/express": "4.17.9",
"@types/express": "4.17.11",
"@types/html-entities": "1.2.16",
"@types/ioredis": "4.17.10",
"@types/jest": "26.0.19",
"@types/lodash": "4.14.166",
"@types/ioredis": "4.26.3",
"@types/jest": "26.0.23",
"@types/lodash": "4.14.168",
"@types/mime-types": "2.1.0",
"@types/mongoose": "5.10.3",
"@types/mongoose": "5.10.5",
"@types/morgan": "1.9.2",
"@types/multer": "1.4.5",
"@types/node": "14.14.16",
"@types/nodemailer": "6.4.0",
"@types/passport-jwt": "3.0.3",
"@types/node": "15.0.2",
"@types/nodemailer": "6.4.1",
"@types/passport-jwt": "3.0.5",
"@types/pug": "2.0.4",
"@types/sharp": "0.26.1",
"@types/sanitize-html": "^2.3.1",
"@types/sharp": "0.28.1",
"@types/shelljs": "0.8.8",
"@types/socket.io": "2.1.12",
"@types/socket.io-redis": "1.0.26",
"@types/socket.io": "2.1.13",
"@types/socket.io-redis": "1.0.27",
"@types/string-template": "1.0.2",
"@types/supertest": "2.0.10",
"@types/supertest": "2.0.11",
"@types/uuid": "8.3.0",
"@typescript-eslint/eslint-plugin": "4.11.0",
"@typescript-eslint/parser": "4.11.0",
"eslint": "7.16.0",
"eslint-config-prettier": "7.1.0",
"@typescript-eslint/eslint-plugin": "4.23.0",
"@typescript-eslint/parser": "4.23.0",
"eslint": "7.26.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.3.1",
"graphql": "15.4.0",
"eslint-plugin-prettier": "3.4.0",
"graphql": "15.5.0",
"husky": "4.3.6",
"jest": "26.6.3",
"lint-staged": "10.5.3",
"plop": "2.7.4",
"prettier": "2.2.1",
"supertest": "6.0.1",
"ts-jest": "26.4.4",
"ts-loader": "8.0.12",
"typescript": "4.1.3"
"prettier": "2.3.0",
"supertest": "6.1.3",
"ts-jest": "26.5.6",
"ts-loader": "9.1.2",
"typescript": "4.2.4"
}
}
4 changes: 2 additions & 2 deletions src/common/classes/dayoff-calculation.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ export class DayOffCalculation {
setDayOffs(startDate: Date, endDate: Date, timezone: string) {
// Remove timezone and set zero second
// https://stackoverflow.com/questions/28198626/display-datetime-with-momentjs-without-timezone-conversion
const start = ((moment(startDate) as unknown) as Moment.Moment)
const start = (moment(startDate) as unknown as Moment.Moment)
.tz(timezone)
.utcOffset(0, true)
.second(0);
const end = ((moment(endDate) as unknown) as Moment.Moment)
const end = (moment(endDate) as unknown as Moment.Moment)
.tz(timezone)
.utcOffset(0, true)
.second(0);
Expand Down
2 changes: 1 addition & 1 deletion src/common/decorators/api-headers.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ApiCustomHeader {

@IsOptional()
@Type(() => Date)
@Transform(value => moment(value))
@Transform(x => moment(x.value))
readonly timestamp: moment.Moment = moment();

constructor(
Expand Down
14 changes: 7 additions & 7 deletions src/common/transformers/sanitize-html.transformer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { Transform } from 'class-transformer';
import { decode } from 'html-entities';
import * as sanitizeHtml from 'sanitize-html';

/*
|*****************************************************************************************************
| EXPLANATION:
Expand All @@ -21,12 +25,8 @@
|*****************************************************************************************************
*/

import { Transform } from 'class-transformer';
import { Html4Entities, Html5Entities } from 'html-entities';
import * as sanitizeHtml from 'sanitize-html';

const { decode: decode4 } = new Html4Entities();
const { decode: decode5 } = new Html5Entities();
const decode4 = (text: string) => decode(text, { level: 'html4' });
const decode5 = (text: string) => decode(text, { level: 'html5' });
const defaultOptions: sanitizeHtml.IOptions = {
allowedAttributes: {
'*': ['style', 'class', 'href', 'src']
Expand All @@ -40,4 +40,4 @@ const defaultOptions: sanitizeHtml.IOptions = {
* @see https://www.npmjs.com/package/html-entities
*/
export const TransformToSanitizeHtml = (option?: sanitizeHtml.IOptions) =>
Transform(v => sanitizeHtml(decode5(decode4(v)), { ...defaultOptions, ...option }));
Transform(({ value }) => sanitizeHtml(decode5(decode4(value)), { ...defaultOptions, ...option }));
3 changes: 2 additions & 1 deletion src/common/transformers/string.transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { Transform } from 'class-transformer';
/**
* Transform string with trim
*/
export const TransformTrimString = () => Transform(v => (typeof v === 'string' ? v.trim() : v));
export const TransformTrimString = () =>
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
2 changes: 1 addition & 1 deletion src/lib/config/config.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ConfigDto {

@IsNotEmpty()
@IsNumber()
@Transform(x => +x)
@Transform(x => +x.value)
PORT!: number;

@IsNotEmpty()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/graphql-request/graphql-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class GraphQLRequest {
*/
async getCharacters(opt: GetCharactersOption) {
const query = gql`
query($page: Int) {
query ($page: Int) {
characters(page: $page) {
info {
count
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ioredis/ioredis.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class IORedisConfig {

@IsNotEmpty()
@IsNumber()
@Transform(x => +x)
@Transform(x => +x.value)
REDIS_PORT!: number;

@IsNotEmpty()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pagination/pagination.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class PaginationDto {
@ApiPropertyOptional({ default: 10, description: 'Limit query data' })
@Min(0)
@Max(100)
@Transform(x => x || 1) // Prevented from query limit in mongodb, .limit(0) will return all from db
@Transform(x => x.value || 1) // Prevented from query limit in mongodb, .limit(0) will return all from db
@TransformToNumber() // Don't remove, look the comment above
readonly limit: number = 10;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sendbird/sendbird.helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HttpService } from '@nestjs/common';
import { AxiosResponse } from '@nestjs/common/node_modules/axios';
import { AxiosResponse } from 'axios';
import * as FormData from 'form-data';
import { Observable } from 'rxjs';

Expand Down
6 changes: 3 additions & 3 deletions src/lib/sequelize/sequelize.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class SequelizeConfig {

@IsNotEmpty()
@IsNumber()
@Transform(x => +x)
@Transform(x => +x.value)
DB_PORT!: number;

@IsNotEmpty()
Expand All @@ -30,11 +30,11 @@ export class SequelizeConfig {

@IsNotEmpty()
@IsBoolean()
@Transform((x: string) => x.toLowerCase() === 'true')
@Transform(x => String(x.value).toLowerCase() === 'true')
DB_LOGGING!: boolean;

@IsNotEmpty()
@IsBoolean()
@Transform((x: string) => x.toLowerCase() === 'true')
@Transform(x => String(x.value).toLowerCase() === 'true')
DB_SYNC!: boolean;
}
4 changes: 1 addition & 3 deletions src/lib/social/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export class Social {
try {
const url = 'https://api.linkedin.com/v1/people/~?format=json';
const headers = { Authorization: `Bearer ${accessToken}` };
const { data } = await this.http
.get<LinkedinResult>(url, { headers })
.toPromise();
const { data } = await this.http.get<LinkedinResult>(url, { headers }).toPromise();
return data;
} catch (e) {
const { response }: AxiosError = e;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tile38/tile38.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Tile38Config {

@IsNotEmpty()
@IsNumber()
@Transform(x => +x)
@Transform(x => +x.value)
TILE38_PORT!: number;

@IsOptional()
Expand Down
Loading

0 comments on commit 92e7d3c

Please sign in to comment.