"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.generatedRoutes = void 0;

var _express = _interopRequireDefault(require("express"));

var _ajv = _interopRequireDefault(require("ajv"));

var _typescriptRoutesToOpenapiServer = require("typescript-routes-to-openapi-server");

var _calendar = require("../../controllers/calendar");

var _configuration = require("../../controllers/configuration");

var _img = require("../../controllers/img");

var _item = require("../../controllers/item");

var _items = require("../../controllers/items");

var _listController = require("../../controllers/listController");

var _listItemController = require("../../controllers/listItemController");

var _listsController = require("../../controllers/listsController");

var _logs = require("../../controllers/logs");

var _progress = require("../../controllers/progress");

var _rating = require("../../controllers/rating");

var _search = require("../../controllers/search");

var _seen = require("../../controllers/seen");

var _statisticsController = require("../../controllers/statisticsController");

var _token = require("../../controllers/token");

var _users = require("../../controllers/users");

var _watchlist = require("../../controllers/watchlist");

var _goodreads = require("../../controllers/import/goodreads");

var _traktTv = require("../../controllers/import/traktTv");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// This file was generated by typescript-routes-to-openapi
const ajv = new _ajv.default({
  allErrors: true,
  coerceTypes: true,
  verbose: true,
  removeAdditional: true
});

const validatorHandler = args => {
  const {
    pathParamsSchema,
    requestQuerySchema,
    requestBodySchema
  } = args;
  const pathParamsValidator = pathParamsSchema && ajv.compile(pathParamsSchema);
  const requestQueryValidator = requestQuerySchema && ajv.compile(requestQuerySchema);
  const requestBodySchemaValidator = requestBodySchema && ajv.compile(requestBodySchema);
  return (req, res, next) => {
    if (pathParamsValidator && !pathParamsValidator(req.params)) {
      next(new _typescriptRoutesToOpenapiServer.ValidationError(pathParamsValidator.errors, ajv.errorsText(pathParamsValidator.errors, {
        dataVar: 'Path params'
      })));
    } else if (requestQueryValidator && !requestQueryValidator(req.query)) {
      next(new _typescriptRoutesToOpenapiServer.ValidationError(requestQueryValidator.errors, ajv.errorsText(requestQueryValidator.errors, {
        dataVar: 'Query string'
      })));
    } else if (requestBodySchemaValidator && !requestBodySchemaValidator(req.body)) {
      next(new _typescriptRoutesToOpenapiServer.ValidationError(requestBodySchemaValidator.errors, ajv.errorsText(requestBodySchemaValidator.errors, {
        dataVar: 'Request body'
      })));
    } else {
      next();
    }
  };
};

const _CalendarController = new _calendar.CalendarController();

const _ConfigurationController = new _configuration.ConfigurationController();

const _ImgController = new _img.ImgController();

const _MediaItemController = new _item.MediaItemController();

const _ItemsController = new _items.ItemsController();

const _ListController = new _listController.ListController();

const _ListItemController = new _listItemController.ListItemController();

const _ListsController = new _listsController.ListsController();

const _LogsController = new _logs.LogsController();

const _ProgressController = new _progress.ProgressController();

const _RatingController = new _rating.RatingController();

const _SearchController = new _search.SearchController();

const _SeenController = new _seen.SeenController();

const _StatisticsController = new _statisticsController.StatisticsController();

const _TokenController = new _token.TokenController();

const _UsersController = new _users.UsersController();

const _WatchlistController = new _watchlist.WatchlistController();

const _GoodreadsImportController = new _goodreads.GoodreadsImportController();

const _TraktTvImportController = new _traktTv.TraktTvImportController();

const router = _express.default.Router();

exports.generatedRoutes = router;
router.get('/api/calendar', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      start: {
        type: ['string', 'null']
      },
      end: {
        type: ['string', 'null']
      }
    }
  }
}), _CalendarController.get);
router.patch('/api/configuration', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      TmdbLang: {
        enum: ['aa', 'ab', 'af', 'am', 'ar', 'as', 'ay', 'az', 'ba', 'be', 'bg', 'bh', 'bi', 'bn', 'bo', 'br', 'ca', 'co', 'cs', 'cy', 'da', 'de', 'dz', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fj', 'fo', 'fr', 'fy', 'ga', 'gd', 'gl', 'gn', 'gu', 'ha', 'he', 'hi', 'hr', 'hu', 'hy', 'ia', 'id', 'ie', 'ik', 'is', 'it', 'iu', 'ja', 'jw', 'ka', 'kk', 'kl', 'km', 'kn', 'ko', 'ks', 'ku', 'ky', 'la', 'ln', 'lo', 'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'mo', 'mr', 'ms', 'mt', 'my', 'na', 'ne', 'nl', 'no', 'oc', 'om', 'or', 'pa', 'pl', 'ps', 'pt', 'qu', 'rm', 'rn', 'ro', 'ru', 'rw', 'sa', 'sd', 'sg', 'sh', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sq', 'sr', 'ss', 'st', 'su', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tr', 'ts', 'tt', 'tw', 'ug', 'uk', 'ur', 'uz', 'vi', 'vo', 'wo', 'xh', 'yi', 'yo', 'za', 'zh', 'zu'],
        type: 'string'
      },
      AudibleLang: {
        enum: ['au', 'ca', 'de', 'es', 'fr', 'in', 'it', 'jp', 'uk', 'us'],
        type: 'string'
      },
      ServerLang: {
        enum: ['da', 'de', 'en', 'es'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      enableRegistration: {
        type: ['boolean', 'null']
      },
      tmdbLang: {
        oneOf: [{
          $ref: '#/definitions/TmdbLang'
        }, {
          type: 'null'
        }]
      },
      audibleLang: {
        oneOf: [{
          $ref: '#/definitions/AudibleLang'
        }, {
          type: 'null'
        }]
      },
      serverLang: {
        oneOf: [{
          $ref: '#/definitions/ServerLang'
        }, {
          type: 'null'
        }]
      },
      igdbClientId: {
        type: ['string', 'null']
      },
      igdbClientSecret: {
        type: ['string', 'null']
      }
    }
  }
}), _ConfigurationController.update);
router.get('/api/configuration', validatorHandler({}), _ConfigurationController.get);
router.get('/img/:id', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      id: {
        type: 'string'
      }
    },
    required: ['id'],
    nullable: false
  },
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      ImgSize: {
        enum: ['original', 'small'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      size: {
        oneOf: [{
          $ref: '#/definitions/ImgSize'
        }, {
          type: 'null'
        }]
      }
    }
  }
}), _ImgController.image);
router.get('/api/details/:mediaItemId', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      }
    },
    required: ['mediaItemId'],
    nullable: false
  }
}), _MediaItemController.details);
router.get('/api/details/update-metadata/:mediaItemId', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      }
    },
    required: ['mediaItemId'],
    nullable: false
  }
}), _MediaItemController.updateMetadata);
router.get('/api/items/paginated', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      GetItemsRequest: {
        allOf: [{
          type: 'object',
          properties: {
            orderBy: {
              oneOf: [{
                $ref: '#/definitions/MediaItemOrderBy'
              }, {
                type: 'null'
              }]
            },
            sortOrder: {
              oneOf: [{
                $ref: '#/definitions/SortOrder'
              }, {
                type: 'null'
              }]
            },
            filter: {
              type: ['string', 'null']
            },
            onlyOnWatchlist: {
              type: ['boolean', 'null']
            },
            onlySeenItems: {
              type: ['boolean', 'null']
            },
            onlyWithNextEpisodesToWatch: {
              type: ['boolean', 'null']
            },
            onlyWithNextAiring: {
              type: ['boolean', 'null']
            },
            onlyWithUserRating: {
              type: ['boolean', 'null']
            },
            onlyWithoutUserRating: {
              type: ['boolean', 'null']
            },
            onlyWithProgress: {
              type: ['boolean', 'null']
            },
            page: {
              type: ['number', 'null']
            }
          }
        }, {
          type: 'object',
          properties: {
            mediaType: {
              oneOf: [{
                $ref: '#/definitions/MediaType'
              }, {
                type: 'null'
              }]
            }
          }
        }]
      },
      MediaItemOrderBy: {
        enum: ['lastAiring', 'lastSeen', 'mediaType', 'nextAiring', 'progress', 'releaseDate', 'status', 'title', 'unseenEpisodes'],
        type: 'string'
      },
      SortOrder: {
        enum: ['asc', 'desc'],
        type: 'string'
      },
      MediaType: {
        enum: ['audiobook', 'book', 'movie', 'tv', 'video_game'],
        type: 'string'
      }
    },
    $ref: '#/definitions/GetItemsRequest'
  }
}), _ItemsController.getPaginated);
router.get('/api/items', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      MediaType: {
        enum: ['audiobook', 'book', 'movie', 'tv', 'video_game'],
        type: 'string'
      },
      MediaItemOrderBy: {
        enum: ['lastAiring', 'lastSeen', 'mediaType', 'nextAiring', 'progress', 'releaseDate', 'status', 'title', 'unseenEpisodes'],
        type: 'string'
      },
      SortOrder: {
        enum: ['asc', 'desc'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      mediaType: {
        oneOf: [{
          $ref: '#/definitions/MediaType'
        }, {
          type: 'null'
        }]
      },
      orderBy: {
        oneOf: [{
          $ref: '#/definitions/MediaItemOrderBy'
        }, {
          type: 'null'
        }]
      },
      sortOrder: {
        oneOf: [{
          $ref: '#/definitions/SortOrder'
        }, {
          type: 'null'
        }]
      },
      filter: {
        type: ['string', 'null']
      },
      onlyOnWatchlist: {
        type: ['boolean', 'null']
      },
      onlySeenItems: {
        type: ['boolean', 'null']
      },
      onlyWithNextEpisodesToWatch: {
        type: ['boolean', 'null']
      },
      onlyWithNextAiring: {
        type: ['boolean', 'null']
      },
      onlyWithUserRating: {
        type: ['boolean', 'null']
      },
      onlyWithoutUserRating: {
        type: ['boolean', 'null']
      },
      onlyWithProgress: {
        type: ['boolean', 'null']
      }
    }
  }
}), _ItemsController.get);
router.put('/api/list', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      ListPrivacy: {
        enum: ['friends', 'private', 'public'],
        type: 'string'
      },
      ListSortBy: {
        enum: ['my-rating', 'next-airing', 'rank', 'recently-added', 'recently-aired', 'recently-watched', 'release-date', 'runtime', 'title'],
        type: 'string'
      },
      ListSortOrder: {
        enum: ['asc', 'desc'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      name: {
        type: 'string'
      },
      description: {
        type: ['string', 'null']
      },
      privacy: {
        oneOf: [{
          $ref: '#/definitions/ListPrivacy'
        }, {
          type: 'null'
        }]
      },
      sortBy: {
        oneOf: [{
          $ref: '#/definitions/ListSortBy'
        }, {
          type: 'null'
        }]
      },
      sortOrder: {
        oneOf: [{
          $ref: '#/definitions/ListSortOrder'
        }, {
          type: 'null'
        }]
      }
    },
    required: ['name']
  }
}), _ListController.add);
router.patch('/api/list', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      ListPrivacy: {
        enum: ['friends', 'private', 'public'],
        type: 'string'
      },
      ListSortBy: {
        enum: ['my-rating', 'next-airing', 'rank', 'recently-added', 'recently-aired', 'recently-watched', 'release-date', 'runtime', 'title'],
        type: 'string'
      },
      ListSortOrder: {
        enum: ['asc', 'desc'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      id: {
        type: 'number'
      },
      name: {
        type: 'string'
      },
      description: {
        type: ['string', 'null']
      },
      privacy: {
        oneOf: [{
          $ref: '#/definitions/ListPrivacy'
        }, {
          type: 'null'
        }]
      },
      sortBy: {
        oneOf: [{
          $ref: '#/definitions/ListSortBy'
        }, {
          type: 'null'
        }]
      },
      sortOrder: {
        oneOf: [{
          $ref: '#/definitions/ListSortOrder'
        }, {
          type: 'null'
        }]
      }
    },
    required: ['id', 'name']
  }
}), _ListController.update);
router.get('/api/list', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      listId: {
        type: 'number'
      }
    },
    required: ['listId']
  }
}), _ListController.get);
router.delete('/api/list', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      listId: {
        type: 'number'
      }
    },
    required: ['listId']
  }
}), _ListController.delete);
router.get('/api/list/items', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      listId: {
        type: 'number'
      }
    },
    required: ['listId']
  }
}), _ListController.getListItems);
router.put('/api/list-item', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      listId: {
        type: 'number'
      },
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    },
    required: ['listId', 'mediaItemId']
  }
}), _ListItemController.addItem);
router.delete('/api/list-item', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      listId: {
        type: 'number'
      },
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    },
    required: ['listId', 'mediaItemId']
  }
}), _ListItemController.removeItem);
router.get('/api/lists', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      userId: {
        type: ['number', 'null']
      },
      mediaItemId: {
        type: ['number', 'null']
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    }
  }
}), _ListsController.getLists);
router.get('/api/logs', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      LogLevels: {
        type: 'object',
        properties: {
          error: {
            type: ['boolean', 'null']
          },
          warn: {
            type: ['boolean', 'null']
          },
          info: {
            type: ['boolean', 'null']
          },
          debug: {
            type: ['boolean', 'null']
          },
          http: {
            type: ['boolean', 'null']
          }
        }
      }
    },
    allOf: [{
      $ref: '#/definitions/LogLevels'
    }, {
      type: 'object',
      properties: {
        count: {
          type: ['number', 'null']
        },
        from: {
          type: ['string', 'null']
        }
      }
    }]
  }
}), _LogsController.add);
router.put('/api/progress', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      episodeId: {
        type: ['number', 'null']
      },
      progress: {
        type: ['number', 'null']
      },
      date: {
        type: ['number', 'null']
      },
      duration: {
        type: ['number', 'null']
      },
      action: {
        enum: ['paused', 'playing', null],
        type: 'string'
      }
    },
    required: ['mediaItemId']
  }
}), _ProgressController.add);
router.delete('/api/progress/:progressId', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      progressId: {
        type: 'number'
      }
    },
    required: ['progressId'],
    nullable: false
  }
}), _ProgressController.deleteById);
router.put('/api/rating', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      },
      rating: {
        type: ['number', 'null']
      },
      review: {
        type: ['string', 'null']
      }
    },
    required: ['mediaItemId']
  }
}), _RatingController.add);
router.get('/api/search', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      MediaType: {
        enum: ['audiobook', 'book', 'movie', 'tv', 'video_game'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      q: {
        type: 'string'
      },
      mediaType: {
        $ref: '#/definitions/MediaType'
      }
    },
    required: ['mediaType', 'q']
  }
}), _SearchController.search);
router.put('/api/seen', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      LastSeenAt: {
        enum: ['custom_date', 'now', 'release_date', 'unknown'],
        type: 'string'
      }
    },
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      },
      lastSeenEpisodeId: {
        type: ['number', 'null']
      },
      lastSeenAt: {
        oneOf: [{
          $ref: '#/definitions/LastSeenAt'
        }, {
          type: 'null'
        }]
      },
      date: {
        type: ['number', 'null']
      }
    },
    required: ['mediaItemId']
  }
}), _SeenController.add);
router.delete('/api/seen/:seenId', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      seenId: {
        type: 'number'
      }
    },
    required: ['seenId'],
    nullable: false
  }
}), _SeenController.deleteById);
router.delete('/api/seen/', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    },
    required: ['mediaItemId']
  }
}), _SeenController.removeFromSeenHistory);
router.get('/api/statistics/summary', validatorHandler({}), _StatisticsController.add);
router.put('/api/tokens', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      description: {
        type: 'string'
      }
    },
    required: ['description']
  }
}), _TokenController.add);
router.delete('/api/tokens', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      description: {
        type: 'string'
      }
    },
    required: ['description']
  }
}), _TokenController.delete);
router.get('/api/tokens', validatorHandler({}), _TokenController.get);
router.get('/api/user', validatorHandler({}), _UsersController.get);
router.get('/api/user/logout', validatorHandler({}), _UsersController.logout);
router.post('/api/user/login', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      username: {
        type: 'string'
      },
      password: {
        type: 'string'
      }
    },
    required: ['password', 'username']
  }
}), _UsersController.login);
router.post('/api/user/register', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      username: {
        type: 'string'
      },
      password: {
        type: 'string'
      },
      confirmPassword: {
        type: 'string'
      }
    },
    required: ['confirmPassword', 'password', 'username']
  }
}), _UsersController.register);
router.get('/api/user/notification-credentials', validatorHandler({}), _UsersController.getNotificationCredentials);
router.put('/api/user/notification-credentials', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    definitions: {
      NotificationPlatformsResponseType: {
        oneOf: [{
          type: 'object',
          properties: {
            platformName: {
              type: 'string',
              enum: ['gotify']
            },
            credentials: {
              type: 'object',
              properties: {
                url: {
                  type: 'string'
                },
                token: {
                  type: 'string'
                },
                priority: {
                  type: 'string'
                }
              },
              required: ['priority', 'token', 'url']
            }
          },
          required: ['credentials', 'platformName']
        }, {
          type: 'object',
          properties: {
            platformName: {
              type: 'string',
              enum: ['Pushbullet']
            },
            credentials: {
              type: 'object',
              properties: {
                token: {
                  type: 'string'
                }
              },
              required: ['token']
            }
          },
          required: ['credentials', 'platformName']
        }, {
          type: 'object',
          properties: {
            platformName: {
              type: 'string',
              enum: ['Pushover']
            },
            credentials: {
              type: 'object',
              properties: {
                key: {
                  type: 'string'
                }
              },
              required: ['key']
            }
          },
          required: ['credentials', 'platformName']
        }, {
          type: 'object',
          properties: {
            platformName: {
              type: 'string',
              enum: ['Pushsafer']
            },
            credentials: {
              type: 'object',
              properties: {
                key: {
                  type: 'string'
                }
              },
              required: ['key']
            }
          },
          required: ['credentials', 'platformName']
        }, {
          type: 'object',
          properties: {
            platformName: {
              type: 'string',
              enum: ['ntfy']
            },
            credentials: {
              type: 'object',
              properties: {
                url: {
                  type: 'string'
                },
                priority: {
                  type: 'string'
                },
                topic: {
                  type: 'string'
                }
              },
              required: ['priority', 'topic', 'url']
            }
          },
          required: ['credentials', 'platformName']
        }]
      }
    },
    $ref: '#/definitions/NotificationPlatformsResponseType'
  }
}), _UsersController.updateNotificationCredentials);
router.put('/api/user/settings', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      name: {
        type: ['string', 'null']
      },
      slug: {
        type: ['string', 'null']
      },
      publicReviews: {
        type: ['boolean', 'null']
      },
      sendNotificationWhenStatusChanges: {
        type: ['boolean', 'null']
      },
      sendNotificationWhenReleaseDateChanges: {
        type: ['boolean', 'null']
      },
      sendNotificationWhenNumberOfSeasonsChanges: {
        type: ['boolean', 'null']
      },
      sendNotificationForReleases: {
        type: ['boolean', 'null']
      },
      sendNotificationForEpisodesReleases: {
        type: ['boolean', 'null']
      },
      notificationPlatform: {
        enum: ['Pushbullet', 'Pushover', 'Pushsafer', 'gotify', 'ntfy', null],
        type: 'string'
      },
      hideOverviewForUnseenSeasons: {
        type: ['boolean', 'null']
      },
      hideEpisodeTitleForUnseenEpisodes: {
        type: ['boolean', 'null']
      }
    }
  }
}), _UsersController.update);
router.put('/api/user/password', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      currentPassword: {
        type: 'string'
      },
      newPassword: {
        type: 'string'
      }
    },
    required: ['currentPassword', 'newPassword']
  }
}), _UsersController.updatePassword);
router.get('/api/user/:userId', validatorHandler({
  pathParamsSchema: {
    type: 'object',
    properties: {
      userId: {
        type: 'number'
      }
    },
    required: ['userId'],
    nullable: false
  }
}), _UsersController.getById);
router.put('/api/watchlist', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    },
    required: ['mediaItemId']
  }
}), _WatchlistController.add);
router.delete('/api/watchlist', validatorHandler({
  requestQuerySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      mediaItemId: {
        type: 'number'
      },
      seasonId: {
        type: ['number', 'null']
      },
      episodeId: {
        type: ['number', 'null']
      }
    },
    required: ['mediaItemId']
  }
}), _WatchlistController.delete);
router.post('/api/import-goodreads', validatorHandler({
  requestBodySchema: {
    $schema: 'http://json-schema.org/draft-07/schema#',
    type: 'object',
    properties: {
      url: {
        type: 'string'
      }
    },
    required: ['url']
  }
}), _GoodreadsImportController.import);
router.get('/api/import-trakttv/device-token', validatorHandler({}), _TraktTvImportController.getUserCode);
router.get('/api/import-trakttv/state', validatorHandler({}), _TraktTvImportController.state);
//# sourceMappingURL=routes.js.map