-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MoeidHeidari/feature/log-parser
Feature/log parser
- Loading branch information
Showing
28 changed files
with
1,013 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x, 15.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"timestamp": 1628475171259, | ||
"logLevel": "error", | ||
"transactionId": "9abc55b2-807b-4361-9dbe-aa88b1b2e978", | ||
"err": "Cannot find user orders list" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
npm install | ||
npm run build | ||
npm test | ||
npm run lint | ||
echo 'Done! 😍' | ||
echo 'now you can use the application by following commmand' | ||
echo 'node dist/cli.js -h' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
import { NestFactory } from '@nestjs/core' | ||
import { CommandModule, CommandService } from 'nestjs-command' | ||
import { AppModule } from './app/app.module' | ||
import { NestFactory } from '@nestjs/core'; | ||
import { CommandModule, CommandService } from 'nestjs-command'; | ||
import { AppModule } from './app/app.module'; | ||
|
||
/** | ||
* Main application entry point | ||
*/ | ||
async function bootstrap () { | ||
async function bootstrap() { | ||
const app = await NestFactory.createApplicationContext(AppModule, { | ||
logger: ['error'], | ||
}) | ||
}); | ||
|
||
try { | ||
await app | ||
.select(CommandModule) | ||
.get(CommandService) | ||
.exec() | ||
await app.close() | ||
await app.select(CommandModule).get(CommandService).exec(); | ||
await app.close(); | ||
} catch (error) { | ||
console.error(error) | ||
await app.close() | ||
process.exit(1) | ||
console.error(error); | ||
await app.close(); | ||
process.exit(1); | ||
} | ||
} | ||
/** | ||
* Bootstraps the application | ||
*/ | ||
bootstrap() | ||
* Bootstraps the application | ||
*/ | ||
bootstrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './utils' | ||
export * from './utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { NotAcceptableException } from "@nestjs/common"; | ||
import { validate } from "class-validator"; | ||
import { validate } from 'class-validator'; | ||
|
||
/** | ||
* validates dto and returns bad request if it is wrong | ||
* @param dto dto | ||
* @param httpResponseGenerator http response service | ||
*/ | ||
export async function validateDTO(dto: any): Promise<any> { | ||
const errors = await validate(dto); | ||
|
||
if (errors.length) throw new Error(`InvalidArgumentExcpetion ${errors}`); | ||
|
||
return dto; | ||
} | ||
|
||
export async function validateDTO(dto: any): Promise<any> { | ||
const errors = await validate(dto); | ||
|
||
if (errors.length) throw new Error(`InvalidArgumentExcpetion ${errors}`); | ||
|
||
return dto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './log-level.enum' | ||
export * from './log-level.enum'; |
Oops, something went wrong.