refactor: update a few dev deps and convert to using type imports where possible (#2886)

* build: bump deps and add some new eslint rules

* refactor: run eslint --fix on code to convert to type imports where possible
pull/2288/head^2
Ryan Cohen 2 years ago committed by GitHub
parent 25eb765f9b
commit f5864b49de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,11 +26,17 @@ module.exports = {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'formatjs/no-offset': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'jsx-a11y/no-onchange': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
},
overrides: [
{
@ -40,7 +46,7 @@ module.exports = {
},
},
],
plugins: ['jsx-a11y', 'prettier', 'react-hooks', 'formatjs'],
plugins: ['jsx-a11y', 'react-hooks', 'formatjs'],
settings: {
react: {
pragma: 'React',

@ -23,6 +23,8 @@ jobs:
run: yarn
- name: Lint
run: yarn lint
- name: Formatting
run: yarn format:check
- name: Build
run: yarn build

@ -15,8 +15,5 @@
"database": "./config/db/db.sqlite3"
}
],
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": true
}

@ -7,13 +7,14 @@
"build:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates",
"build:next": "next build",
"build": "yarn build:next && yarn build:server",
"lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\"",
"lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\" --cache",
"start": "NODE_ENV=production node dist/index.js",
"i18n:extract": "extract-messages -l=en -o src/i18n/locale -d en --flat true --overwriteDefault true \"./src/**/!(*.test).{ts,tsx}\"",
"migration:generate": "ts-node --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:generate",
"migration:create": "ts-node --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:create",
"migration:run": "ts-node --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:run",
"format": "prettier --write .",
"format": "prettier --loglevel warn --write --cache .",
"format:check": "prettier --check --cache .",
"prepare": "husky install"
},
"repository": {
@ -121,26 +122,27 @@
"commitizen": "^4.2.4",
"copyfiles": "^2.4.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.11.0",
"eslint-config-next": "^12.1.0",
"eslint": "^8.21.0",
"eslint-config-next": "^12.2.3",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-formatjs": "^3.0.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-formatjs": "^4.0.2",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"extract-react-intl-messages": "^4.1.1",
"husky": "^7.0.4",
"lint-staged": "^12.3.5",
"nodemon": "^2.0.15",
"postcss": "^8.4.8",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.8",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"semantic-release": "^19.0.2",
"semantic-release-docker-buildx": "^1.0.1",
"tailwindcss": "^3.0.23",
"tailwindcss": "^3.1.7",
"ts-node": "^10.7.0",
"typescript": "^4.6.2"
"typescript": "^4.7.4"
},
"resolutions": {
"sqlite3/node-gyp": "^8.4.1"

@ -1,6 +1,7 @@
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import axios from 'axios';
import rateLimit from 'axios-rate-limit';
import NodeCache from 'node-cache';
import type NodeCache from 'node-cache';
// 5 minute default TTL (in seconds)
const DEFAULT_TTL = 300;

@ -1,5 +1,6 @@
import NodePlexAPI from 'plex-api';
import { getSettings, Library, PlexSettings } from '../lib/settings';
import type { Library, PlexSettings } from '../lib/settings';
import { getSettings } from '../lib/settings';
import logger from '../logger';
export interface PlexLibraryItem {
@ -130,7 +131,6 @@ class PlexAPI {
});
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public async getStatus() {
return await this.plexClient.query('/');
}

@ -1,6 +1,7 @@
import axios, { AxiosInstance } from 'axios';
import type { AxiosInstance } from 'axios';
import axios from 'axios';
import xml2js from 'xml2js';
import { PlexDevice } from '../interfaces/api/plexInterfaces';
import type { PlexDevice } from '../interfaces/api/plexInterfaces';
import { getSettings } from '../lib/settings';
import logger from '../logger';

@ -1,5 +1,6 @@
import cacheManager, { AvailableCacheIds } from '../../lib/cache';
import { DVRSettings } from '../../lib/settings';
import type { AvailableCacheIds } from '../../lib/cache';
import cacheManager from '../../lib/cache';
import type { DVRSettings } from '../../lib/settings';
import ExternalAPI from '../externalapi';
export interface SystemStatus {

@ -1,7 +1,8 @@
import axios, { AxiosInstance } from 'axios';
import type { AxiosInstance } from 'axios';
import axios from 'axios';
import { uniqWith } from 'lodash';
import { User } from '../entity/User';
import { TautulliSettings } from '../lib/settings';
import type { User } from '../entity/User';
import type { TautulliSettings } from '../lib/settings';
import logger from '../logger';
export interface TautulliHistoryRecord {

@ -1,7 +1,7 @@
import { sortBy } from 'lodash';
import cacheManager from '../../lib/cache';
import ExternalAPI from '../externalapi';
import {
import type {
TmdbCollection,
TmdbExternalIdResponse,
TmdbGenre,

@ -7,7 +7,8 @@ import {
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { IssueStatus, IssueType } from '../constants/issue';
import type { IssueType } from '../constants/issue';
import { IssueStatus } from '../constants/issue';
import IssueComment from './IssueComment';
import Media from './Media';
import { User } from './User';

@ -13,7 +13,8 @@ import {
import RadarrAPI from '../api/servarr/radarr';
import SonarrAPI from '../api/servarr/sonarr';
import { MediaStatus, MediaType } from '../constants/media';
import downloadTracker, { DownloadingItem } from '../lib/downloadtracker';
import type { DownloadingItem } from '../lib/downloadtracker';
import downloadTracker from '../lib/downloadtracker';
import { getSettings } from '../lib/settings';
import logger from '../logger';
import Issue from './Issue';

@ -13,11 +13,10 @@ import {
RelationCount,
UpdateDateColumn,
} from 'typeorm';
import RadarrAPI, { RadarrMovieOptions } from '../api/servarr/radarr';
import SonarrAPI, {
AddSeriesOptions,
SonarrSeries,
} from '../api/servarr/sonarr';
import type { RadarrMovieOptions } from '../api/servarr/radarr';
import RadarrAPI from '../api/servarr/radarr';
import type { AddSeriesOptions, SonarrSeries } from '../api/servarr/sonarr';
import SonarrAPI from '../api/servarr/sonarr';
import TheMovieDb from '../api/themoviedb';
import { ANIME_KEYWORD_ID } from '../api/themoviedb/constants';
import { MediaRequestStatus, MediaStatus, MediaType } from '../constants/media';

@ -1,4 +1,4 @@
import { ISession } from 'connect-typeorm';
import type { ISession } from 'connect-typeorm';
import { Index, Column, PrimaryColumn, Entity } from 'typeorm';
@Entity()

@ -18,13 +18,10 @@ import {
} from 'typeorm';
import { MediaRequestStatus, MediaType } from '../constants/media';
import { UserType } from '../constants/user';
import { QuotaResponse } from '../interfaces/api/userInterfaces';
import type { QuotaResponse } from '../interfaces/api/userInterfaces';
import PreparedEmail from '../lib/email';
import {
hasPermission,
Permission,
PermissionCheckOptions,
} from '../lib/permissions';
import type { PermissionCheckOptions } from '../lib/permissions';
import { hasPermission, Permission } from '../lib/permissions';
import { getSettings } from '../lib/settings';
import logger from '../logger';
import Issue from './Issue';

@ -5,7 +5,7 @@ import {
OneToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { NotificationAgentTypes } from '../interfaces/api/userSettingsInterfaces';
import type { NotificationAgentTypes } from '../interfaces/api/userSettingsInterfaces';
import { hasNotificationType, Notification } from '../lib/notifications';
import { NotificationAgentKey } from '../lib/settings';
import { User } from './User';

@ -2,9 +2,11 @@ import { getClientIp } from '@supercharge/request-ip';
import { TypeormStore } from 'connect-typeorm/out';
import cookieParser from 'cookie-parser';
import csurf from 'csurf';
import express, { NextFunction, Request, Response } from 'express';
import type { NextFunction, Request, Response } from 'express';
import express from 'express';
import * as OpenApiValidator from 'express-openapi-validator';
import session, { Store } from 'express-session';
import type { Store } from 'express-session';
import session from 'express-session';
import next from 'next';
import path from 'path';
import swaggerUi from 'swagger-ui-express';

@ -1,5 +1,5 @@
import Issue from '../../entity/Issue';
import { PaginatedResponse } from './common';
import type Issue from '../../entity/Issue';
import type { PaginatedResponse } from './common';
export interface IssueResultsResponse extends PaginatedResponse {
results: Issue[];

@ -1,6 +1,6 @@
import type Media from '../../entity/Media';
import { User } from '../../entity/User';
import { PaginatedResponse } from './common';
import type { User } from '../../entity/User';
import type { PaginatedResponse } from './common';
export interface MediaResultsResponse extends PaginatedResponse {
results: Media[];

@ -1,4 +1,4 @@
import { PersonCreditCast, PersonCreditCrew } from '../../models/Person';
import type { PersonCreditCast, PersonCreditCrew } from '../../models/Person';
export interface PersonCombinedCreditsResponse {
id: number;

@ -1,4 +1,4 @@
import { PlexSettings } from '../../lib/settings';
import type { PlexSettings } from '../../lib/settings';
export interface PlexStatus {
settings: PlexSettings;

@ -1,5 +1,5 @@
import { QualityProfile, RootFolder, Tag } from '../../api/servarr/base';
import { LanguageProfile } from '../../api/servarr/sonarr';
import type { QualityProfile, RootFolder, Tag } from '../../api/servarr/base';
import type { LanguageProfile } from '../../api/servarr/sonarr';
export interface ServiceCommonServer {
id: number;

@ -1,7 +1,7 @@
import Media from '../../entity/Media';
import { MediaRequest } from '../../entity/MediaRequest';
import type Media from '../../entity/Media';
import type { MediaRequest } from '../../entity/MediaRequest';
import type { User } from '../../entity/User';
import { PaginatedResponse } from './common';
import type { PaginatedResponse } from './common';
export interface UserResultsResponse extends PaginatedResponse {
results: User[];

@ -1,4 +1,4 @@
import { NotificationAgentKey } from '../../lib/settings';
import type { NotificationAgentKey } from '../../lib/settings';
export interface UserSettingsGeneralResponse {
username?: string;

@ -3,7 +3,8 @@ import downloadTracker from '../lib/downloadtracker';
import { plexFullScanner, plexRecentScanner } from '../lib/scanners/plex';
import { radarrScanner } from '../lib/scanners/radarr';
import { sonarrScanner } from '../lib/scanners/sonarr';
import { getSettings, JobId } from '../lib/settings';
import type { JobId } from '../lib/settings';
import { getSettings } from '../lib/settings';
import logger from '../logger';
interface ScheduledJob {

@ -1,7 +1,8 @@
import Email from 'email-templates';
import nodemailer from 'nodemailer';
import { URL } from 'url';
import { getSettings, NotificationAgentEmail } from '../settings';
import type { NotificationAgentEmail } from '../settings';
import { getSettings } from '../settings';
import { openpgpEncrypt } from './openpgpEncrypt';
class PreparedEmail extends Email {

@ -1,6 +1,7 @@
import { randomBytes } from 'crypto';
import * as openpgp from 'openpgp';
import { Transform, TransformCallback } from 'stream';
import type { TransformCallback } from 'stream';
import { Transform } from 'stream';
import logger from '../../logger';
interface EncryptorOptions {

@ -1,10 +1,10 @@
import { Notification } from '..';
import type { Notification } from '..';
import type Issue from '../../../entity/Issue';
import IssueComment from '../../../entity/IssueComment';
import Media from '../../../entity/Media';
import { MediaRequest } from '../../../entity/MediaRequest';
import { User } from '../../../entity/User';
import { NotificationAgentConfig } from '../../settings';
import type IssueComment from '../../../entity/IssueComment';
import type Media from '../../../entity/Media';
import type { MediaRequest } from '../../../entity/MediaRequest';
import type { User } from '../../../entity/User';
import type { NotificationAgentConfig } from '../../settings';
export interface NotificationPayload {
event?: string;

@ -8,12 +8,10 @@ import {
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import { User } from '../../../entity/User';
import logger from '../../../logger';
import {
getSettings,
NotificationAgentDiscord,
NotificationAgentKey,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentDiscord } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
enum EmbedColors {
DEFAULT = 0,

@ -1,4 +1,4 @@
import { EmailOptions } from 'email-templates';
import type { EmailOptions } from 'email-templates';
import path from 'path';
import { getRepository } from 'typeorm';
import { Notification, shouldSendAdminNotification } from '..';
@ -7,12 +7,10 @@ import { MediaType } from '../../../constants/media';
import { User } from '../../../entity/User';
import logger from '../../../logger';
import PreparedEmail from '../../email';
import {
getSettings,
NotificationAgentEmail,
NotificationAgentKey,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentEmail } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
class EmailAgent
extends BaseAgent<NotificationAgentEmail>

@ -2,8 +2,10 @@ import axios from 'axios';
import { hasNotificationType, Notification } from '..';
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import logger from '../../../logger';
import { getSettings, NotificationAgentGotify } from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentGotify } from '../../settings';
import { getSettings } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface GotifyPayload {
title: string;

@ -3,8 +3,10 @@ import { hasNotificationType, Notification } from '..';
import { IssueStatus, IssueType } from '../../../constants/issue';
import { MediaStatus } from '../../../constants/media';
import logger from '../../../logger';
import { getSettings, NotificationAgentLunaSea } from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentLunaSea } from '../../settings';
import { getSettings } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
class LunaSeaAgent
extends BaseAgent<NotificationAgentLunaSea>

@ -8,12 +8,10 @@ import {
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import { User } from '../../../entity/User';
import logger from '../../../logger';
import {
getSettings,
NotificationAgentKey,
NotificationAgentPushbullet,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentPushbullet } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface PushbulletPayload {
type: string;

@ -8,12 +8,10 @@ import {
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import { User } from '../../../entity/User';
import logger from '../../../logger';
import {
getSettings,
NotificationAgentKey,
NotificationAgentPushover,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentPushover } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface PushoverPayload {
token: string;

@ -2,8 +2,10 @@ import axios from 'axios';
import { hasNotificationType, Notification } from '..';
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import logger from '../../../logger';
import { getSettings, NotificationAgentSlack } from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentSlack } from '../../settings';
import { getSettings } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface EmbedField {
type: 'plain_text' | 'mrkdwn';

@ -8,12 +8,10 @@ import {
import { IssueStatus, IssueTypeName } from '../../../constants/issue';
import { User } from '../../../entity/User';
import logger from '../../../logger';
import {
getSettings,
NotificationAgentKey,
NotificationAgentTelegram,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentTelegram } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface TelegramMessagePayload {
text: string;

@ -4,8 +4,10 @@ import { hasNotificationType, Notification } from '..';
import { IssueStatus, IssueType } from '../../../constants/issue';
import { MediaStatus } from '../../../constants/media';
import logger from '../../../logger';
import { getSettings, NotificationAgentWebhook } from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentWebhook } from '../../settings';
import { getSettings } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
type KeyMapFunction = (
payload: NotificationPayload,

@ -6,12 +6,10 @@ import { MediaType } from '../../../constants/media';
import { User } from '../../../entity/User';
import { UserPushSubscription } from '../../../entity/UserPushSubscription';
import logger from '../../../logger';
import {
getSettings,
NotificationAgentConfig,
NotificationAgentKey,
} from '../../settings';
import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
import type { NotificationAgentConfig } from '../../settings';
import { getSettings, NotificationAgentKey } from '../../settings';
import type { NotificationAgent, NotificationPayload } from './agent';
import { BaseAgent } from './agent';
interface PushNotificationPayload {
notificationType: string;

@ -1,4 +1,4 @@
import { User } from '../../entity/User';
import type { User } from '../../entity/User';
import logger from '../../logger';
import { Permission } from '../permissions';
import type { NotificationAgent, NotificationPayload } from './agents/agent';

@ -1,17 +1,20 @@
import { uniqWith } from 'lodash';
import { getRepository } from 'typeorm';
import animeList from '../../../api/animelist';
import PlexAPI, { PlexLibraryItem, PlexMetadata } from '../../../api/plexapi';
import { TmdbTvDetails } from '../../../api/themoviedb/interfaces';
import type { PlexLibraryItem, PlexMetadata } from '../../../api/plexapi';
import PlexAPI from '../../../api/plexapi';
import type { TmdbTvDetails } from '../../../api/themoviedb/interfaces';
import { User } from '../../../entity/User';
import cacheManager from '../../cache';
import { getSettings, Library } from '../../settings';
import BaseScanner, {
import type { Library } from '../../settings';
import { getSettings } from '../../settings';
import type {
MediaIds,
ProcessableSeason,
RunnableScanner,
StatusBase,
} from '../baseScanner';
import BaseScanner from '../baseScanner';
const imdbRegex = new RegExp(/imdb:\/\/(tt[0-9]+)/);
const tmdbRegex = new RegExp(/tmdb:\/\/([0-9]+)/);

@ -1,7 +1,10 @@
import { uniqWith } from 'lodash';
import RadarrAPI, { RadarrMovie } from '../../../api/servarr/radarr';
import { getSettings, RadarrSettings } from '../../settings';
import BaseScanner, { RunnableScanner, StatusBase } from '../baseScanner';
import type { RadarrMovie } from '../../../api/servarr/radarr';
import RadarrAPI from '../../../api/servarr/radarr';
import type { RadarrSettings } from '../../settings';
import { getSettings } from '../../settings';
import type { RunnableScanner, StatusBase } from '../baseScanner';
import BaseScanner from '../baseScanner';
type SyncStatus = StatusBase & {
currentServer: RadarrSettings;

@ -1,14 +1,17 @@
import { uniqWith } from 'lodash';
import { getRepository } from 'typeorm';
import SonarrAPI, { SonarrSeries } from '../../../api/servarr/sonarr';
import { TmdbTvDetails } from '../../../api/themoviedb/interfaces';
import type { SonarrSeries } from '../../../api/servarr/sonarr';
import SonarrAPI from '../../../api/servarr/sonarr';
import type { TmdbTvDetails } from '../../../api/themoviedb/interfaces';
import Media from '../../../entity/Media';
import { getSettings, SonarrSettings } from '../../settings';
import BaseScanner, {
import type { SonarrSettings } from '../../settings';
import { getSettings } from '../../settings';
import type {
ProcessableSeason,
RunnableScanner,
StatusBase,
} from '../baseScanner';
import BaseScanner from '../baseScanner';
type SyncStatus = StatusBase & {
currentServer: SonarrSettings;

@ -1,5 +1,5 @@
import TheMovieDb from '../api/themoviedb';
import {
import type {
TmdbMovieDetails,
TmdbMovieResult,
TmdbPersonDetails,

@ -1,6 +1,6 @@
import { getRepository } from 'typeorm';
import { User } from '../entity/User';
import { Permission, PermissionCheckOptions } from '../lib/permissions';
import type { Permission, PermissionCheckOptions } from '../lib/permissions';
import { getSettings } from '../lib/settings';
export const checkUser: Middleware = async (req, _res, next) => {

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class InitialMigration1603944374840 implements MigrationInterface {
name = 'InitialMigration1603944374840';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class SeasonStatus1605085519544 implements MigrationInterface {
name = 'SeasonStatus1605085519544';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class CascadeMigration1606730060700 implements MigrationInterface {
name = 'CascadeMigration1606730060700';

@ -1,4 +1,5 @@
import { MigrationInterface, QueryRunner, TableUnique } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
import { TableUnique } from 'typeorm';
export class DropImdbIdConstraint1607928251245 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserRequestDeleteCascades1608219049304
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddLastSeasonChangeMedia1608477467935
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class ForceDropImdbUniqueConstraint1608477467935
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class RemoveTmdbIdUniqueConstraint1609236552057
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class LocalUsers1610070934506 implements MigrationInterface {
name = 'LocalUsers1610070934506';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class Add4kStatusFields1610370640747 implements MigrationInterface {
name = 'Add4kStatusFields1610370640747';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddMediaAddedFieldToMedia1610522845513
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddDisplayNameToUser1611508672722 implements MigrationInterface {
name = 'AddDisplayNameToUser1611508672722';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class SonarrRadarrSyncServiceFields1611757511674
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddRatingKeysToMedia1611801511397 implements MigrationInterface {
name = 'AddRatingKeysToMedia1611801511397';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddResetPasswordGuidAndExpiryDate1612482778137
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddLanguageProfileId1612571545781 implements MigrationInterface {
name = 'AddLanguageProfileId1612571545781';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateUserSettings1613615266968 implements MigrationInterface {
name = 'CreateUserSettings1613615266968';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateUserSettingsRegions1613955393450
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddTelegramSettingsToUserSettings1614334195680
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddPGPToUserSettings1615333940450 implements MigrationInterface {
name = 'AddPGPToUserSettings1615333940450';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserQuotaFields1616576677254 implements MigrationInterface {
name = 'AddUserQuotaFields1616576677254';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateTagsFieldonMediaRequest1617624225464
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserSettingsNotificationAgentsField1617730837489
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateUserPushSubscriptions1618912653565
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserSettingsLocale1619239659754 implements MigrationInterface {
name = 'AddUserSettingsLocale1619239659754';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserSettingsNotificationTypes1619339817343
implements MigrationInterface

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddIssues1634904083966 implements MigrationInterface {
name = 'AddIssues1634904083966';

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import type { MigrationInterface, QueryRunner } from 'typeorm';
export class AddPushbulletPushoverUserSettings1635079863457
implements MigrationInterface

@ -1,8 +1,9 @@
import { sortBy } from 'lodash';
import type { TmdbCollection } from '../api/themoviedb/interfaces';
import { MediaType } from '../constants/media';
import Media from '../entity/Media';
import { mapMovieResult, MovieResult } from './Search';
import type Media from '../entity/Media';
import type { MovieResult } from './Search';
import { mapMovieResult } from './Search';
export interface Collection {
id: number;

@ -3,19 +3,21 @@ import type {
TmdbMovieReleaseResult,
TmdbProductionCompany,
} from '../api/themoviedb/interfaces';
import Media from '../entity/Media';
import {
import type Media from '../entity/Media';
import type {
Cast,
Crew,
ExternalIds,
Genre,
ProductionCompany,
WatchProviders,
} from './common';
import {
mapCast,
mapCrew,
mapExternalIds,
mapVideos,
mapWatchProviders,
ProductionCompany,
WatchProviders,
} from './common';
export interface Video {

@ -3,7 +3,7 @@ import type {
TmdbPersonCreditCrew,
TmdbPersonDetails,
} from '../api/themoviedb/interfaces';
import Media from '../entity/Media';
import type Media from '../entity/Media';
export interface PersonDetails {
id: number;

@ -7,7 +7,7 @@ import type {
TmdbTvResult,
} from '../api/themoviedb/interfaces';
import { MediaType as MainMediaType } from '../constants/media';
import Media from '../entity/Media';
import type Media from '../entity/Media';
export type MediaType = 'tv' | 'movie' | 'person';

@ -7,22 +7,24 @@ import type {
TmdbTvSeasonResult,
} from '../api/themoviedb/interfaces';
import type Media from '../entity/Media';
import {
import type {
Cast,
Crew,
ExternalIds,
Genre,
Keyword,
ProductionCompany,
TvNetwork,
WatchProviders,
} from './common';
import {
mapAggregateCast,
mapCrew,
mapExternalIds,
mapVideos,
mapWatchProviders,
ProductionCompany,
TvNetwork,
WatchProviders,
} from './common';
import { Video } from './Movie';
import type { Video } from './Movie';
interface Episode {
id: number;

@ -8,7 +8,7 @@ import type {
TmdbWatchProviderDetails,
TmdbWatchProviders,
} from '../api/themoviedb/interfaces';
import { Video } from '../models/Movie';
import type { Video } from '../models/Movie';
export interface ProductionCompany {
id: number;

@ -3,8 +3,8 @@ import { sortBy } from 'lodash';
import TheMovieDb from '../api/themoviedb';
import { MediaType } from '../constants/media';
import Media from '../entity/Media';
import { User } from '../entity/User';
import { GenreSliderItem } from '../interfaces/api/discoverInterfaces';
import type { User } from '../entity/User';
import type { GenreSliderItem } from '../interfaces/api/discoverInterfaces';
import { getSettings } from '../lib/settings';
import logger from '../logger';
import { mapProductionCompany } from '../models/Movie';

@ -1,8 +1,11 @@
import { Router } from 'express';
import GithubAPI from '../api/github';
import TheMovieDb from '../api/themoviedb';
import { TmdbMovieResult, TmdbTvResult } from '../api/themoviedb/interfaces';
import { StatusResponse } from '../interfaces/api/settingsInterfaces';
import type {
TmdbMovieResult,
TmdbTvResult,
} from '../api/themoviedb/interfaces';
import type { StatusResponse } from '../interfaces/api/settingsInterfaces';
import { Permission } from '../lib/permissions';
import { getSettings } from '../lib/settings';
import logger from '../logger';

@ -4,7 +4,7 @@ import { IssueStatus, IssueType } from '../constants/issue';
import Issue from '../entity/Issue';
import IssueComment from '../entity/IssueComment';
import Media from '../entity/Media';
import { IssueResultsResponse } from '../interfaces/api/issueInterfaces';
import type { IssueResultsResponse } from '../interfaces/api/issueInterfaces';
import { Permission } from '../lib/permissions';
import logger from '../logger';
import { isAuthenticated } from '../middleware/auth';

@ -1,10 +1,11 @@
import { Router } from 'express';
import { FindOneOptions, FindOperator, getRepository, In } from 'typeorm';
import type { FindOneOptions, FindOperator } from 'typeorm';
import { getRepository, In } from 'typeorm';
import TautulliAPI from '../api/tautulli';
import { MediaStatus, MediaType } from '../constants/media';
import Media from '../entity/Media';
import { User } from '../entity/User';
import {
import type {
MediaResultsResponse,
MediaWatchDataResponse,
} from '../interfaces/api/mediaInterfaces';

@ -6,7 +6,7 @@ import Media from '../entity/Media';
import { MediaRequest } from '../entity/MediaRequest';
import SeasonRequest from '../entity/SeasonRequest';
import { User } from '../entity/User';
import { RequestResultsResponse } from '../interfaces/api/requestInterfaces';
import type { RequestResultsResponse } from '../interfaces/api/requestInterfaces';
import { Permission } from '../lib/permissions';
import logger from '../logger';
import { isAuthenticated } from '../middleware/auth';

@ -1,6 +1,6 @@
import { Router } from 'express';
import TheMovieDb from '../api/themoviedb';
import { TmdbSearchMultiResponse } from '../api/themoviedb/interfaces';
import type { TmdbSearchMultiResponse } from '../api/themoviedb/interfaces';
import Media from '../entity/Media';
import { findSearchProvider } from '../lib/search';
import logger from '../logger';

@ -2,7 +2,7 @@ import { Router } from 'express';
import RadarrAPI from '../api/servarr/radarr';
import SonarrAPI from '../api/servarr/sonarr';
import TheMovieDb from '../api/themoviedb';
import {
import type {
ServiceCommonServer,
ServiceCommonServerWithDetails,
} from '../interfaces/api/serviceInterfaces';

@ -13,17 +13,19 @@ import TautulliAPI from '../../api/tautulli';
import Media from '../../entity/Media';
import { MediaRequest } from '../../entity/MediaRequest';
import { User } from '../../entity/User';
import { PlexConnection } from '../../interfaces/api/plexInterfaces';
import {
import type { PlexConnection } from '../../interfaces/api/plexInterfaces';
import type {
LogMessage,
LogsResultsResponse,
SettingsAboutResponse,
} from '../../interfaces/api/settingsInterfaces';
import { scheduledJobs } from '../../job/schedule';
import cacheManager, { AvailableCacheIds } from '../../lib/cache';
import type { AvailableCacheIds } from '../../lib/cache';
import cacheManager from '../../lib/cache';
import { Permission } from '../../lib/permissions';
import { plexFullScanner } from '../../lib/scanners/plex';
import { getSettings, MainSettings } from '../../lib/settings';
import type { MainSettings } from '../../lib/settings';
import { getSettings } from '../../lib/settings';
import logger from '../../logger';
import { isAuthenticated } from '../../middleware/auth';
import { appDataPath } from '../../utils/appDataVolume';

@ -1,7 +1,7 @@
import { Router } from 'express';
import { User } from '../../entity/User';
import type { User } from '../../entity/User';
import { Notification } from '../../lib/notifications';
import { NotificationAgent } from '../../lib/notifications/agents/agent';
import type { NotificationAgent } from '../../lib/notifications/agents/agent';
import DiscordAgent from '../../lib/notifications/agents/discord';
import EmailAgent from '../../lib/notifications/agents/email';
import GotifyAgent from '../../lib/notifications/agents/gotify';

@ -1,6 +1,7 @@
import { Router } from 'express';
import RadarrAPI from '../../api/servarr/radarr';
import { getSettings, RadarrSettings } from '../../lib/settings';
import type { RadarrSettings } from '../../lib/settings';
import { getSettings } from '../../lib/settings';
import logger from '../../logger';
const radarrRoutes = Router();

@ -1,6 +1,7 @@
import { Router } from 'express';
import SonarrAPI from '../../api/servarr/sonarr';
import { getSettings, SonarrSettings } from '../../lib/settings';
import type { SonarrSettings } from '../../lib/settings';
import { getSettings } from '../../lib/settings';
import logger from '../../logger';
const sonarrRoutes = Router();

@ -10,7 +10,7 @@ import Media from '../../entity/Media';
import { MediaRequest } from '../../entity/MediaRequest';
import { User } from '../../entity/User';
import { UserPushSubscription } from '../../entity/UserPushSubscription';
import {
import type {
QuotaResponse,
UserRequestsResponse,
UserResultsResponse,

@ -3,7 +3,7 @@ import { getRepository } from 'typeorm';
import { canMakePermissionsChange } from '.';
import { User } from '../../entity/User';
import { UserSettings } from '../../entity/UserSettings';
import {
import type {
UserSettingsGeneralResponse,
UserSettingsNotificationsResponse,
} from '../../interfaces/api/userSettingsInterfaces';

@ -1,10 +1,6 @@
import { sortBy } from 'lodash';
import {
EntitySubscriberInterface,
EventSubscriber,
getRepository,
InsertEvent,
} from 'typeorm';
import type { EntitySubscriberInterface, InsertEvent } from 'typeorm';
import { EventSubscriber, getRepository } from 'typeorm';
import TheMovieDb from '../api/themoviedb';
import { IssueType, IssueTypeName } from '../constants/issue';
import { MediaType } from '../constants/media';

@ -1,10 +1,10 @@
import { sortBy } from 'lodash';
import {
import type {
EntitySubscriberInterface,
EventSubscriber,
InsertEvent,
UpdateEvent,
} from 'typeorm';
import { EventSubscriber } from 'typeorm';
import TheMovieDb from '../api/themoviedb';
import { IssueStatus, IssueType, IssueTypeName } from '../constants/issue';
import { MediaType } from '../constants/media';

@ -1,11 +1,6 @@
import { truncate } from 'lodash';
import {
EntitySubscriberInterface,
EventSubscriber,
getRepository,
Not,
UpdateEvent,
} from 'typeorm';
import type { EntitySubscriberInterface, UpdateEvent } from 'typeorm';
import { EventSubscriber, getRepository, Not } from 'typeorm';
import TheMovieDb from '../api/themoviedb';
import { MediaRequestStatus, MediaStatus, MediaType } from '../constants/media';
import Media from '../entity/Media';

@ -1,4 +1,5 @@
import React, { ForwardedRef } from 'react';
import type { ForwardedRef } from 'react';
import React from 'react';
export type ButtonType =
| 'default'

@ -1,11 +1,10 @@
import { ChevronDownIcon } from '@heroicons/react/solid';
import React, {
import type {
AnchorHTMLAttributes,
ButtonHTMLAttributes,
ReactNode,
useRef,
useState,
} from 'react';
import React, { useRef, useState } from 'react';
import useClickOutside from '../../../hooks/useClickOutside';
import { withProperties } from '../../../utils/typeHelpers';
import Transition from '../../Transition';

@ -1,4 +1,5 @@
import Image, { ImageProps } from 'next/image';
import type { ImageProps } from 'next/image';
import Image from 'next/image';
import React from 'react';
import useSettings from '../../../hooks/useSettings';

@ -1,9 +1,5 @@
import React, {
ForwardRefRenderFunction,
HTMLAttributes,
useEffect,
useState,
} from 'react';
import type { ForwardRefRenderFunction, HTMLAttributes } from 'react';
import React, { useEffect, useState } from 'react';
import CachedImage from '../CachedImage';
interface ImageFaderProps extends HTMLAttributes<HTMLDivElement> {

@ -1,6 +1,6 @@
import React from 'react';
import { useIntl } from 'react-intl';
import {
import type {
MovieResult,
PersonResult,
TvResult,

@ -1,11 +1,13 @@
import React, { MouseEvent, ReactNode, useRef } from 'react';
import type { MouseEvent, ReactNode } from 'react';
import React, { useRef } from 'react';
import ReactDOM from 'react-dom';
import { useIntl } from 'react-intl';
import useClickOutside from '../../../hooks/useClickOutside';
import { useLockBodyScroll } from '../../../hooks/useLockBodyScroll';
import globalMessages from '../../../i18n/globalMessages';
import Transition from '../../Transition';
import Button, { ButtonType } from '../Button';
import type { ButtonType } from '../Button';
import Button from '../Button';
import CachedImage from '../CachedImage';
import LoadingSpinner from '../LoadingSpinner';

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save