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

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

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

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

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

Loading…
Cancel
Save