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

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

@ -15,8 +15,5 @@
"database": "./config/db/db.sqlite3" "database": "./config/db/db.sqlite3"
} }
], ],
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": 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:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates",
"build:next": "next build", "build:next": "next build",
"build": "yarn build:next && yarn build:server", "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", "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}\"", "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: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: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", "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" "prepare": "husky install"
}, },
"repository": { "repository": {
@ -121,26 +122,27 @@
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"eslint": "^8.11.0", "eslint": "^8.21.0",
"eslint-config-next": "^12.1.0", "eslint-config-next": "^12.2.3",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-formatjs": "^3.0.0", "eslint-plugin-formatjs": "^4.0.2",
"eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.29.3", "eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-react-hooks": "^4.6.0",
"extract-react-intl-messages": "^4.1.1", "extract-react-intl-messages": "^4.1.1",
"husky": "^7.0.4", "husky": "^7.0.4",
"lint-staged": "^12.3.5", "lint-staged": "^12.3.5",
"nodemon": "^2.0.15", "nodemon": "^2.0.15",
"postcss": "^8.4.8", "postcss": "^8.4.8",
"prettier": "^2.5.1", "prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.8", "prettier-plugin-organize-imports": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"semantic-release": "^19.0.2", "semantic-release": "^19.0.2",
"semantic-release-docker-buildx": "^1.0.1", "semantic-release-docker-buildx": "^1.0.1",
"tailwindcss": "^3.0.23", "tailwindcss": "^3.1.7",
"ts-node": "^10.7.0", "ts-node": "^10.7.0",
"typescript": "^4.6.2" "typescript": "^4.7.4"
}, },
"resolutions": { "resolutions": {
"sqlite3/node-gyp": "^8.4.1" "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 rateLimit from 'axios-rate-limit';
import NodeCache from 'node-cache'; import type NodeCache from 'node-cache';
// 5 minute default TTL (in seconds) // 5 minute default TTL (in seconds)
const DEFAULT_TTL = 300; const DEFAULT_TTL = 300;

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

@ -1,5 +1,6 @@
import cacheManager, { AvailableCacheIds } from '../../lib/cache'; import type { AvailableCacheIds } from '../../lib/cache';
import { DVRSettings } from '../../lib/settings'; import cacheManager from '../../lib/cache';
import type { DVRSettings } from '../../lib/settings';
import ExternalAPI from '../externalapi'; import ExternalAPI from '../externalapi';
export interface SystemStatus { 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 { uniqWith } from 'lodash';
import { User } from '../entity/User'; import type { User } from '../entity/User';
import { TautulliSettings } from '../lib/settings'; import type { TautulliSettings } from '../lib/settings';
import logger from '../logger'; import logger from '../logger';
export interface TautulliHistoryRecord { export interface TautulliHistoryRecord {

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

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

@ -13,7 +13,8 @@ import {
import RadarrAPI from '../api/servarr/radarr'; import RadarrAPI from '../api/servarr/radarr';
import SonarrAPI from '../api/servarr/sonarr'; import SonarrAPI from '../api/servarr/sonarr';
import { MediaStatus, MediaType } from '../constants/media'; 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 { getSettings } from '../lib/settings';
import logger from '../logger'; import logger from '../logger';
import Issue from './Issue'; import Issue from './Issue';

@ -13,11 +13,10 @@ import {
RelationCount, RelationCount,
UpdateDateColumn, UpdateDateColumn,
} from 'typeorm'; } from 'typeorm';
import RadarrAPI, { RadarrMovieOptions } from '../api/servarr/radarr'; import type { RadarrMovieOptions } from '../api/servarr/radarr';
import SonarrAPI, { import RadarrAPI from '../api/servarr/radarr';
AddSeriesOptions, import type { AddSeriesOptions, SonarrSeries } from '../api/servarr/sonarr';
SonarrSeries, import SonarrAPI from '../api/servarr/sonarr';
} from '../api/servarr/sonarr';
import TheMovieDb from '../api/themoviedb'; import TheMovieDb from '../api/themoviedb';
import { ANIME_KEYWORD_ID } from '../api/themoviedb/constants'; import { ANIME_KEYWORD_ID } from '../api/themoviedb/constants';
import { MediaRequestStatus, MediaStatus, MediaType } from '../constants/media'; 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'; import { Index, Column, PrimaryColumn, Entity } from 'typeorm';
@Entity() @Entity()

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

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

@ -2,9 +2,11 @@ import { getClientIp } from '@supercharge/request-ip';
import { TypeormStore } from 'connect-typeorm/out'; import { TypeormStore } from 'connect-typeorm/out';
import cookieParser from 'cookie-parser'; import cookieParser from 'cookie-parser';
import csurf from 'csurf'; 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 * 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 next from 'next';
import path from 'path'; import path from 'path';
import swaggerUi from 'swagger-ui-express'; import swaggerUi from 'swagger-ui-express';

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

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

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

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

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

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

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

@ -3,7 +3,8 @@ import downloadTracker from '../lib/downloadtracker';
import { plexFullScanner, plexRecentScanner } from '../lib/scanners/plex'; import { plexFullScanner, plexRecentScanner } from '../lib/scanners/plex';
import { radarrScanner } from '../lib/scanners/radarr'; import { radarrScanner } from '../lib/scanners/radarr';
import { sonarrScanner } from '../lib/scanners/sonarr'; 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'; import logger from '../logger';
interface ScheduledJob { interface ScheduledJob {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,6 +1,6 @@
import { getRepository } from 'typeorm'; import { getRepository } from 'typeorm';
import { User } from '../entity/User'; import { User } from '../entity/User';
import { Permission, PermissionCheckOptions } from '../lib/permissions'; import type { Permission, PermissionCheckOptions } from '../lib/permissions';
import { getSettings } from '../lib/settings'; import { getSettings } from '../lib/settings';
export const checkUser: Middleware = async (req, _res, next) => { 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 { export class InitialMigration1603944374840 implements MigrationInterface {
name = 'InitialMigration1603944374840'; name = 'InitialMigration1603944374840';

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

@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import type { MigrationInterface, QueryRunner } from 'typeorm';
export class CascadeMigration1606730060700 implements MigrationInterface { export class CascadeMigration1606730060700 implements MigrationInterface {
name = 'CascadeMigration1606730060700'; 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 { export class DropImdbIdConstraint1607928251245 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> { 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 export class AddUserRequestDeleteCascades1608219049304
implements MigrationInterface implements MigrationInterface

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,10 +1,11 @@
import { Router } from 'express'; 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 TautulliAPI from '../api/tautulli';
import { MediaStatus, MediaType } from '../constants/media'; import { MediaStatus, MediaType } from '../constants/media';
import Media from '../entity/Media'; import Media from '../entity/Media';
import { User } from '../entity/User'; import { User } from '../entity/User';
import { import type {
MediaResultsResponse, MediaResultsResponse,
MediaWatchDataResponse, MediaWatchDataResponse,
} from '../interfaces/api/mediaInterfaces'; } from '../interfaces/api/mediaInterfaces';

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

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

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

@ -13,17 +13,19 @@ import TautulliAPI from '../../api/tautulli';
import Media from '../../entity/Media'; import Media from '../../entity/Media';
import { MediaRequest } from '../../entity/MediaRequest'; import { MediaRequest } from '../../entity/MediaRequest';
import { User } from '../../entity/User'; import { User } from '../../entity/User';
import { PlexConnection } from '../../interfaces/api/plexInterfaces'; import type { PlexConnection } from '../../interfaces/api/plexInterfaces';
import { import type {
LogMessage, LogMessage,
LogsResultsResponse, LogsResultsResponse,
SettingsAboutResponse, SettingsAboutResponse,
} from '../../interfaces/api/settingsInterfaces'; } from '../../interfaces/api/settingsInterfaces';
import { scheduledJobs } from '../../job/schedule'; 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 { Permission } from '../../lib/permissions';
import { plexFullScanner } from '../../lib/scanners/plex'; 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 logger from '../../logger';
import { isAuthenticated } from '../../middleware/auth'; import { isAuthenticated } from '../../middleware/auth';
import { appDataPath } from '../../utils/appDataVolume'; import { appDataPath } from '../../utils/appDataVolume';

@ -1,7 +1,7 @@
import { Router } from 'express'; import { Router } from 'express';
import { User } from '../../entity/User'; import type { User } from '../../entity/User';
import { Notification } from '../../lib/notifications'; 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 DiscordAgent from '../../lib/notifications/agents/discord';
import EmailAgent from '../../lib/notifications/agents/email'; import EmailAgent from '../../lib/notifications/agents/email';
import GotifyAgent from '../../lib/notifications/agents/gotify'; import GotifyAgent from '../../lib/notifications/agents/gotify';

@ -1,6 +1,7 @@
import { Router } from 'express'; import { Router } from 'express';
import RadarrAPI from '../../api/servarr/radarr'; 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'; import logger from '../../logger';
const radarrRoutes = Router(); const radarrRoutes = Router();

@ -1,6 +1,7 @@
import { Router } from 'express'; import { Router } from 'express';
import SonarrAPI from '../../api/servarr/sonarr'; 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'; import logger from '../../logger';
const sonarrRoutes = Router(); const sonarrRoutes = Router();

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

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

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

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

@ -1,11 +1,6 @@
import { truncate } from 'lodash'; import { truncate } from 'lodash';
import { import type { EntitySubscriberInterface, UpdateEvent } from 'typeorm';
EntitySubscriberInterface, import { EventSubscriber, getRepository, Not } from 'typeorm';
EventSubscriber,
getRepository,
Not,
UpdateEvent,
} from 'typeorm';
import TheMovieDb from '../api/themoviedb'; import TheMovieDb from '../api/themoviedb';
import { MediaRequestStatus, MediaStatus, MediaType } from '../constants/media'; import { MediaRequestStatus, MediaStatus, MediaType } from '../constants/media';
import Media from '../entity/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 = export type ButtonType =
| 'default' | 'default'

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

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

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { import type {
MovieResult, MovieResult,
PersonResult, PersonResult,
TvResult, 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 ReactDOM from 'react-dom';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import useClickOutside from '../../../hooks/useClickOutside'; import useClickOutside from '../../../hooks/useClickOutside';
import { useLockBodyScroll } from '../../../hooks/useLockBodyScroll'; import { useLockBodyScroll } from '../../../hooks/useLockBodyScroll';
import globalMessages from '../../../i18n/globalMessages'; import globalMessages from '../../../i18n/globalMessages';
import Transition from '../../Transition'; import Transition from '../../Transition';
import Button, { ButtonType } from '../Button'; import type { ButtonType } from '../Button';
import Button from '../Button';
import CachedImage from '../CachedImage'; import CachedImage from '../CachedImage';
import LoadingSpinner from '../LoadingSpinner'; import LoadingSpinner from '../LoadingSpinner';

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

Loading…
Cancel
Save