Browse Source

FORMAT CODE

merge-requests/24/merge
Vitalik 3 years ago
parent
commit
3cfd7fc35e
  1. 4
      .husky/pre-commit
  2. 26006
      package-lock.json
  3. 179
      package.json
  4. 25
      src/domain/permissions/entities/user-permissions.entity.ts
  5. 1
      src/libs/jwt/jwt.module.ts

4
.husky/pre-commit

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx pretty-quick --staged

26006
package-lock.json generated

File diff suppressed because it is too large Load Diff

179
package.json

@ -1,90 +1,93 @@ @@ -1,90 +1,93 @@
{
"name": "api-taskme",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "pm2-runtime start ecosystem.config.js",
"build:dev": " nest build --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "nest start --debug",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"docs": "npx @compodoc/compodoc -p tsconfig.json -s --theme laravel --hideGenerator --name TaskMe --customLogo ./logo.png"
},
"dependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/core": "^7.0.0",
"@nestjs/event-emitter": "^1.0.0",
"@nestjs/platform-express": "^7.0.0",
"@nestjs/swagger": "^4.7.5",
"@nestjs/typeorm": "^8.0.1",
"aes256": "^1.1.0",
"awesome-phonenumber": "^2.55.0",
"class-transformer": "^0.4.0",
"class-validator": "^0.13.1",
"dotenv": "^10.0.0",
"express-basic-auth": "^1.2.0",
"ioredis": "^4.27.7",
"jsonwebtoken": "^8.5.1",
"minio": "^7.0.19",
"pg": "^8.7.1",
"randomstring": "^1.2.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.3.0",
"secure-compare": "^3.0.1",
"swagger-ui-express": "^4.1.6",
"typeorm": "^0.2.36"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.14",
"@nestjs/cli": "^7.0.0",
"@nestjs/schematics": "^7.0.0",
"@nestjs/testing": "^7.0.0",
"@types/express": "^4.17.3",
"@types/ioredis": "^4.26.7",
"@types/jest": "26.0.10",
"@types/minio": "^7.0.9",
"@types/multer": "^1.4.7",
"@types/node": "^13.9.1",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "3.9.1",
"@typescript-eslint/parser": "3.9.1",
"env-cmd": "^10.1.0",
"eslint": "7.7.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"jest": "26.4.2",
"prettier": "^1.19.1",
"supertest": "^4.0.2",
"ts-jest": "26.2.0",
"ts-loader": "^6.2.1",
"ts-node": "9.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
"name": "api-taskme",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "pm2-runtime start ecosystem.config.js",
"build:dev": " nest build --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "nest start --debug",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"docs": "npx @compodoc/compodoc -p tsconfig.json -s --theme laravel --hideGenerator --name TaskMe --customLogo ./logo.png",
"prepare": "husky install"
},
"dependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/core": "^7.0.0",
"@nestjs/event-emitter": "^1.0.0",
"@nestjs/platform-express": "^7.0.0",
"@nestjs/swagger": "^4.7.5",
"@nestjs/typeorm": "^8.0.1",
"aes256": "^1.1.0",
"awesome-phonenumber": "^2.55.0",
"class-transformer": "^0.4.0",
"class-validator": "^0.13.1",
"dotenv": "^10.0.0",
"express-basic-auth": "^1.2.0",
"ioredis": "^4.27.7",
"jsonwebtoken": "^8.5.1",
"minio": "^7.0.19",
"pg": "^8.7.1",
"randomstring": "^1.2.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.3.0",
"secure-compare": "^3.0.1",
"swagger-ui-express": "^4.1.6",
"typeorm": "^0.2.36"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.14",
"@nestjs/cli": "^7.0.0",
"@nestjs/schematics": "^7.0.0",
"@nestjs/testing": "^7.0.0",
"@types/express": "^4.17.3",
"@types/ioredis": "^4.26.7",
"@types/jest": "26.0.10",
"@types/minio": "^7.0.9",
"@types/multer": "^1.4.7",
"@types/node": "^13.9.1",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "3.9.1",
"@typescript-eslint/parser": "3.9.1",
"env-cmd": "^10.1.0",
"eslint": "7.7.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"husky": "^7.0.0",
"jest": "26.4.2",
"prettier": "^1.19.1",
"pretty-quick": "^3.1.1",
"supertest": "^4.0.2",
"ts-jest": "26.2.0",
"ts-loader": "^6.2.1",
"ts-node": "9.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}

25
src/domain/permissions/entities/user-permissions.entity.ts

@ -1,6 +1,14 @@ @@ -1,6 +1,14 @@
import { Permissions } from "src/core"
import { User } from "src/domain/users/entities"
import { Column, CreateDateColumn, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"
import { Permissions } from 'src/core'
import { User } from 'src/domain/users/entities'
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm'
@Entity('usersPermissions')
export class UserPermissions implements Permissions.IUserPermissions {
@ -10,19 +18,16 @@ export class UserPermissions implements Permissions.IUserPermissions { @@ -10,19 +18,16 @@ export class UserPermissions implements Permissions.IUserPermissions {
@Column()
userId: number
@OneToOne(
() => User,
{ onDelete: 'CASCADE' },
)
@OneToOne(() => User, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'userId' })
user?: User
@Column({
type: 'json'
@Column({
type: 'json',
})
permissions: string
@CreateDateColumn({ type: 'timestamp', default: () => 'LOCALTIMESTAMP' })
@CreateDateColumn({ type: 'timestamp', default: () => 'LOCALTIMESTAMP' })
createdAt: string
@UpdateDateColumn({ type: 'timestamp', default: () => 'LOCALTIMESTAMP' })

1
src/libs/jwt/jwt.module.ts

@ -22,7 +22,6 @@ export class JwtModule { @@ -22,7 +22,6 @@ export class JwtModule {
}
static forRoot(options: JwtModuleOptions): DynamicModule {
console.log('JwtModule.options')
JwtModule.options = options
return {

Loading…
Cancel
Save