1
0
Fork 0

Fix broken dep

This commit is contained in:
Chocobozzz 2022-02-09 17:48:15 +01:00
parent 57a9b61a4a
commit 9d8ef212ff
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 16 additions and 22 deletions

View file

@ -117,7 +117,7 @@
"js-yaml": "^4.0.0",
"jsonld": "~5.2.0",
"lodash": "^4.17.10",
"lru-cache": "^7.3.0",
"lru-cache": "6",
"magnet-uri": "^6.1.0",
"markdown-it": "^12.0.4",
"markdown-it-emoji": "^2.0.0",
@ -137,7 +137,7 @@
"redis": "^4.0.1",
"reflect-metadata": "^0.1.12",
"sanitize-html": "2.x",
"sequelize": "6.16.1",
"sequelize": "6.15.1",
"sequelize-typescript": "^2.0.0-beta.1",
"short-uuid": "^4.2.0",
"sitemap": "^7.0.0",

View file

@ -9,9 +9,9 @@ import { UserAdminFlag } from '@shared/models/users/user-flag.model'
import { UserRole } from '@shared/models/users/user-role'
import { logger } from '../../helpers/logger'
import { CONFIG } from '../../initializers/config'
import { UserModel } from '../../models/user/user'
import { OAuthClientModel } from '../../models/oauth/oauth-client'
import { OAuthTokenModel } from '../../models/oauth/oauth-token'
import { UserModel } from '../../models/user/user'
import { createUserAccountAndChannelAndPlaylist } from '../user'
import { TokensCache } from './tokens-cache'
@ -116,6 +116,7 @@ async function getUser (usernameOrEmail?: string, password?: string, bypassLogin
logger.debug('Getting User (username/email: ' + usernameOrEmail + ', password: ******).')
const user = await UserModel.loadByUsernameOrEmail(usernameOrEmail)
// If we don't find the user, or if the user belongs to a plugin
if (!user || user.pluginAuth !== null || !password) return null

View file

@ -48,14 +48,14 @@ import {
isUserEmailVerifiedValid,
isUserNoModal,
isUserNSFWPolicyValid,
isUserP2PEnabledValid,
isUserPasswordValid,
isUserRoleValid,
isUserUsernameValid,
isUserVideoLanguages,
isUserVideoQuotaDailyValid,
isUserVideoQuotaValid,
isUserVideosHistoryEnabledValid,
isUserP2PEnabledValid
isUserVideosHistoryEnabledValid
} from '../../helpers/custom-validators/users'
import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto'
import { DEFAULT_USER_THEME_NAME, NSFW_POLICY_TYPES } from '../../initializers/constants'
@ -623,7 +623,7 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
const query = {
where: {
[Op.or]: [
where(fn('lower', col('username')), '=', fn('lower', username)),
where(fn('lower', col('username')), fn('lower', username) as any),
{ email }
]

View file

@ -1,5 +1,4 @@
import { literal, Op, OrderItem, Sequelize } from 'sequelize'
import { Col } from 'sequelize/types/utils'
import validator from 'validator'
type SortType = { sortModel: string, sortValue: string }
@ -8,7 +7,7 @@ type SortType = { sortModel: string, sortValue: string }
function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderItem[] {
const { direction, field } = buildDirectionAndField(value)
let finalField: string | Col
let finalField: string | ReturnType<typeof Sequelize.col>
if (field.toLowerCase() === 'match') { // Search
finalField = Sequelize.col('similarity')
@ -65,7 +64,7 @@ function getVideoSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): Or
]
}
let finalField: string | Col
let finalField: string | ReturnType<typeof Sequelize.col>
// Alias
if (field.toLowerCase() === 'match') { // Search

View file

@ -1,7 +1,7 @@
import { remove } from 'fs-extra'
import memoizee from 'memoizee'
import { join } from 'path'
import { FindOptions, Op, Transaction } from 'sequelize'
import { FindOptions, Op, Transaction, WhereOptions } from 'sequelize'
import {
AllowNull,
BelongsTo,
@ -18,7 +18,6 @@ import {
Table,
UpdatedAt
} from 'sequelize-typescript'
import { Where } from 'sequelize/types/utils'
import validator from 'validator'
import { buildRemoteVideoBaseUrl } from '@server/helpers/activitypub'
import { logger } from '@server/helpers/logger'
@ -70,7 +69,7 @@ export enum ScopeNames {
}
]
},
[ScopeNames.WITH_VIDEO_OR_PLAYLIST]: (options: { whereVideo?: Where } = {}) => {
[ScopeNames.WITH_VIDEO_OR_PLAYLIST]: (options: { whereVideo?: WhereOptions } = {}) => {
return {
include: [
{

View file

@ -5639,18 +5639,13 @@ lru-cache@4.1.x:
pseudomap "^1.0.2"
yallist "^2.1.2"
lru-cache@^6.0.0:
lru-cache@6, lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
lru-cache@^7.3.0:
version "7.3.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.3.0.tgz#475ed4a39610204d8d23b243e902ed074dd8052d"
integrity sha512-itGqsGM9i3Jt0ZbEkYRKQ3K/Q61vOLNuUkmK0jyjt1VH76gfcvjHmPC6e9uvjSrKOP2aN3T9L1vN0nxQSkrAjA==
lru-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3"
@ -7506,10 +7501,10 @@ sequelize-typescript@^2.0.0-beta.1:
dependencies:
glob "7.2.0"
sequelize@6.16.1:
version "6.16.1"
resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-6.16.1.tgz#2c84036ae0a64843cdfa52c8e3d0bee9c52ce116"
integrity sha512-YFGqrwkmEhSbpZBxay5+PRKMiZNNUJzgIixCyFkLm9+/5Rqq5jBADEjTAC8RYHzwsOGNboYh18imXrYNCjBZCQ==
sequelize@6.15.1:
version "6.15.1"
resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-6.15.1.tgz#6fa2515564b04c87d355d0b54bf94910e411d140"
integrity sha512-UR4LMSnZ13pYL4gNOXxbmreIX1pqanSgAKy4hWjQupHHLOzF3ryckg92axirB68QJy4gaVIaknjhoO3M8zKo8A==
dependencies:
"@types/debug" "^4.1.7"
debug "^4.3.3"