Skip to content

Commit

Permalink
Merge pull request #501 from andrechristikan/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
andrechristikan committed Dec 14, 2023
2 parents 6c68afc + 2e1718c commit 4e51a44
Show file tree
Hide file tree
Showing 18 changed files with 1,136 additions and 1,058 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
APP_NAME=ACK
APP_ENV=development
APP_LANGUAGE=en
APP_TZ=Asia/Jakarta
APP_MAINTENANCE=false

HTTP_ENABLE=true
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ack-nestjs-boilerplate",
"version": "5.6.2",
"version": "5.6.3",
"description": "Ack NestJs Boilerplate",
"repository": {
"type": "git",
Expand Down Expand Up @@ -47,8 +47,8 @@
"rollback": "yarn rollback:email && yarn rollback:apikey && yarn rollback:user && yarn rollback:role"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.462.0",
"@aws-sdk/client-ses": "^3.462.0",
"@aws-sdk/client-s3": "^3.473.0",
"@aws-sdk/client-ses": "^3.473.0",
"@casl/ability": "^6.5.0",
"@faker-js/faker": "^8.3.1",
"@joi/date": "^2.1.0",
Expand All @@ -58,33 +58,34 @@
"@nestjs/core": "^10.2.10",
"@nestjs/jwt": "^10.2.0",
"@nestjs/mongoose": "^10.0.2",
"@nestjs/passport": "^10.0.2",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.2.10",
"@nestjs/schedule": "^4.0.0",
"@nestjs/swagger": "^7.1.16",
"@nestjs/swagger": "^7.1.17",
"@nestjs/terminus": "^10.2.0",
"@nestjs/throttler": "^5.0.1",
"@nestjs/throttler": "^5.1.0",
"@ntegral/nestjs-sentry": "^4.0.0",
"@sentry/node": "^7.84.0",
"@sentry/node": "^7.87.0",
"@types/response-time": "^2.3.8",
"axios": "^1.6.2",
"bcryptjs": "^2.4.3",
"case": "^1.6.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"crypto-js": "^4.2.0",
"google-auth-library": "^9.4.0",
"google-auth-library": "^9.4.1",
"helmet": "^7.1.0",
"joi": "^17.11.0",
"moment": "^2.29.4",
"mongoose": "^8.0.2",
"moment-timezone": "^0.5.43",
"mongoose": "^8.0.3",
"nest-winston": "^1.9.4",
"nestjs-command": "^3.1.4",
"nestjs-i18n": "^10.3.7",
"nestjs-i18n": "^10.4.0",
"passport": "^0.7.0",
"passport-headerapikey": "^1.2.2",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.1.13",
"reflect-metadata": "^0.2.0",
"response-time": "^2.3.2",
"rimraf": "^5.0.5",
"rotating-file-stream": "^3.1.1",
Expand All @@ -106,30 +107,30 @@
"@types/cron": "^2.0.1",
"@types/crypto-js": "^4.2.1",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.10",
"@types/jest": "^29.5.11",
"@types/lodash": "^4.14.202",
"@types/ms": "^0.7.34",
"@types/multer": "^1.4.11",
"@types/node": "^20.10.1",
"@types/node": "^20.10.4",
"@types/passport-jwt": "^3.0.13",
"@types/supertest": "^2.0.16",
"@types/ua-parser-js": "^0.7.39",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"cspell": "^8.0.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"cspell": "^8.1.3",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"supertest": "^6.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"ts-prune": "^0.10.3",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}
2 changes: 2 additions & 0 deletions src/app/constants/app.enum.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export enum ENUM_APP_ENVIRONMENT {
STAGING = 'staging',
DEVELOPMENT = 'development',
}

export const APP_TZ = 'Asia/Jakarta';
1 change: 1 addition & 0 deletions src/common/aws/interfaces/aws.s3-service.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export interface IAwsS3Service {
parts: CompletedPart[]
): Promise<void>;
abortMultipart(path: string, uploadId: string): Promise<void>;
getFilenameFromCompletedUrl(completedUrl: string): Promise<string>;
}
4 changes: 4 additions & 0 deletions src/common/aws/services/aws.s3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,8 @@ export class AwsS3Service implements IAwsS3Service {
throw err;
}
}

async getFilenameFromCompletedUrl(completedUrl: string): Promise<string> {
return completedUrl.replace(`${this.baseUrl}/`, '');
}
}
1 change: 1 addition & 0 deletions src/common/common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { PolicyModule } from 'src/common/policy/policy.module';
.valid(...Object.values(ENUM_MESSAGE_LANGUAGE))
.default(APP_LANGUAGE)
.required(),
APP_TZ: Joi.string().required(),
APP_MAINTENANCE: Joi.boolean().default(false).required(),

HTTP_ENABLE: Joi.boolean().default(true).required(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsISO8601, IsOptional, ValidateIf } from 'class-validator';
import { IsDateString, IsOptional, ValidateIf } from 'class-validator';
import { GreaterThanEqual } from 'src/common/request/validations/request.greater-than-equal.validation';

export class DashboardDto {
Expand All @@ -8,7 +8,7 @@ export class DashboardDto {
required: false,
nullable: true,
})
@IsISO8601()
@IsDateString()
@IsOptional()
@ValidateIf((e) => e.startDate !== '' || e.endDate !== '')
startDate?: Date;
Expand All @@ -18,7 +18,7 @@ export class DashboardDto {
required: false,
nullable: true,
})
@IsISO8601()
@IsDateString()
@IsOptional()
@GreaterThanEqual('startDate')
@ValidateIf((e) => e.startDate !== '' || e.endDate !== '')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardDto } from 'src/common/dashboard/dtos/dashboard';
import { DashboardDto } from 'src/common/dashboard/dtos/dashboard.dto';
import { IDashboardStartAndEndDate } from 'src/common/dashboard/interfaces/dashboard.interface';

export interface IDashboardService {
Expand Down
2 changes: 1 addition & 1 deletion src/common/dashboard/services/dashboard.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { DashboardDto } from 'src/common/dashboard/dtos/dashboard';
import { DashboardDto } from 'src/common/dashboard/dtos/dashboard.dto';
import { IDashboardStartAndEndDate } from 'src/common/dashboard/interfaces/dashboard.interface';
import { IDashboardService } from 'src/common/dashboard/interfaces/dashboard.service.interface';
import { HelperDateService } from 'src/common/helper/services/helper.date.service';
Expand Down
Loading

0 comments on commit 4e51a44

Please sign in to comment.