From 9450f500d663865b40c478f4a67d198bc6c9a200 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 29 Aug 2021 18:57:00 +0200 Subject: [PATCH] Cleanup some imports Signed-off-by: David Mehren --- src/api/public/me/me.controller.ts | 4 ++-- src/auth/mock-auth.guard.ts | 1 + src/media/backends/filesystem-backend.ts | 3 +-- src/media/backends/imgur-backend.ts | 3 +-- src/media/backends/s3-backend.ts | 3 +-- src/media/backends/webdav-backend.ts | 3 +-- src/notes/notes.service.ts | 2 -- src/revisions/revision.entity.ts | 3 ++- src/revisions/revisions.service.spec.ts | 1 - src/users/user.entity.ts | 3 ++- 10 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/api/public/me/me.controller.ts b/src/api/public/me/me.controller.ts index 9e1cab702..9fcb1e36f 100644 --- a/src/api/public/me/me.controller.ts +++ b/src/api/public/me/me.controller.ts @@ -9,12 +9,12 @@ import { Delete, Get, HttpCode, + InternalServerErrorException, NotFoundException, Param, Put, - UseGuards, Req, - InternalServerErrorException, + UseGuards, } from '@nestjs/common'; import { ApiNoContentResponse, diff --git a/src/auth/mock-auth.guard.ts b/src/auth/mock-auth.guard.ts index bd713484c..da19d1767 100644 --- a/src/auth/mock-auth.guard.ts +++ b/src/auth/mock-auth.guard.ts @@ -12,6 +12,7 @@ import { UsersService } from '../users/users.service'; @Injectable() export class MockAuthGuard { private user: User; + constructor(private usersService: UsersService) {} async canActivate(context: ExecutionContext): Promise { diff --git a/src/media/backends/filesystem-backend.ts b/src/media/backends/filesystem-backend.ts index 928687773..413cef904 100644 --- a/src/media/backends/filesystem-backend.ts +++ b/src/media/backends/filesystem-backend.ts @@ -7,8 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { promises as fs } from 'fs'; import { join } from 'path'; -import mediaConfiguration from '../../config/media.config'; -import { MediaConfig } from '../../config/media.config'; +import mediaConfiguration, { MediaConfig } from '../../config/media.config'; import { MediaBackendError } from '../../errors/errors'; import { ConsoleLoggerService } from '../../logger/console-logger.service'; import { MediaBackend } from '../media-backend.interface'; diff --git a/src/media/backends/imgur-backend.ts b/src/media/backends/imgur-backend.ts index 6fb674edb..22541007b 100644 --- a/src/media/backends/imgur-backend.ts +++ b/src/media/backends/imgur-backend.ts @@ -7,8 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import fetch, { Response } from 'node-fetch'; import { URLSearchParams } from 'url'; -import mediaConfiguration from '../../config/media.config'; -import { MediaConfig } from '../../config/media.config'; +import mediaConfiguration, { MediaConfig } from '../../config/media.config'; import { MediaBackendError } from '../../errors/errors'; import { ConsoleLoggerService } from '../../logger/console-logger.service'; import { MediaBackend } from '../media-backend.interface'; diff --git a/src/media/backends/s3-backend.ts b/src/media/backends/s3-backend.ts index ca82e7e29..ca755b9b2 100644 --- a/src/media/backends/s3-backend.ts +++ b/src/media/backends/s3-backend.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Client } from 'minio'; -import mediaConfiguration from '../../config/media.config'; -import { MediaConfig } from '../../config/media.config'; +import mediaConfiguration, { MediaConfig } from '../../config/media.config'; import { MediaBackendError } from '../../errors/errors'; import { ConsoleLoggerService } from '../../logger/console-logger.service'; import { MediaBackend } from '../media-backend.interface'; diff --git a/src/media/backends/webdav-backend.ts b/src/media/backends/webdav-backend.ts index c580bdcd1..25a7a6e6c 100644 --- a/src/media/backends/webdav-backend.ts +++ b/src/media/backends/webdav-backend.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import fetch, { Response } from 'node-fetch'; -import mediaConfiguration from '../../config/media.config'; -import { MediaConfig } from '../../config/media.config'; +import mediaConfiguration, { MediaConfig } from '../../config/media.config'; import { MediaBackendError } from '../../errors/errors'; import { ConsoleLoggerService } from '../../logger/console-logger.service'; import { MediaBackend } from '../media-backend.interface'; diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index 4863db88c..58dcc0de0 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -5,8 +5,6 @@ */ import { forwardRef, Inject, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import base32Encode from 'base32-encode'; -import { randomBytes } from 'crypto'; import { Repository } from 'typeorm'; import appConfiguration, { AppConfig } from '../config/app.config'; diff --git a/src/revisions/revision.entity.ts b/src/revisions/revision.entity.ts index bb4cb9ae8..3684d0e80 100644 --- a/src/revisions/revision.entity.ts +++ b/src/revisions/revision.entity.ts @@ -7,10 +7,11 @@ import { Column, CreateDateColumn, Entity, + JoinTable, + ManyToMany, ManyToOne, PrimaryGeneratedColumn, } from 'typeorm'; -import { JoinTable, ManyToMany } from 'typeorm'; import { Note } from '../notes/note.entity'; import { Edit } from './edit.entity'; diff --git a/src/revisions/revisions.service.spec.ts b/src/revisions/revisions.service.spec.ts index 097220461..95c7da207 100644 --- a/src/revisions/revisions.service.spec.ts +++ b/src/revisions/revisions.service.spec.ts @@ -10,7 +10,6 @@ import { Repository } from 'typeorm'; import { AuthToken } from '../auth/auth-token.entity'; import { Author } from '../authors/author.entity'; -import { AuthorsModule } from '../authors/authors.module'; import appConfigMock from '../config/mock/app.config.mock'; import { NotInDBError } from '../errors/errors'; import { Group } from '../groups/group.entity'; diff --git a/src/users/user.entity.ts b/src/users/user.entity.ts index 9da63d5a9..3d77437ed 100644 --- a/src/users/user.entity.ts +++ b/src/users/user.entity.ts @@ -4,13 +4,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ import { + Column, CreateDateColumn, Entity, ManyToMany, + OneToMany, PrimaryGeneratedColumn, UpdateDateColumn, } from 'typeorm'; -import { Column, OneToMany } from 'typeorm'; import { AuthToken } from '../auth/auth-token.entity'; import { Author } from '../authors/author.entity';