aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r--server/models/account/user.ts45
1 files changed, 23 insertions, 22 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 5f45f8e7c..22e6715b4 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -1,3 +1,5 @@
1import * as Bluebird from 'bluebird'
2import { values } from 'lodash'
1import { col, FindOptions, fn, literal, Op, QueryTypes, where, WhereOptions } from 'sequelize' 3import { col, FindOptions, fn, literal, Op, QueryTypes, where, WhereOptions } from 'sequelize'
2import { 4import {
3 AfterDestroy, 5 AfterDestroy,
@@ -19,8 +21,21 @@ import {
19 Table, 21 Table,
20 UpdatedAt 22 UpdatedAt
21} from 'sequelize-typescript' 23} from 'sequelize-typescript'
22import { hasUserRight, MyUser, USER_ROLE_LABELS, UserRight, AbuseState, VideoPlaylistType, VideoPrivacy } from '../../../shared' 24import {
25 MMyUserFormattable,
26 MUserDefault,
27 MUserFormattable,
28 MUserId,
29 MUserNotifSettingChannelDefault,
30 MUserWithNotificationSetting,
31 MVideoFullLight
32} from '@server/types/models'
33import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users'
34import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models'
23import { User, UserRole } from '../../../shared/models/users' 35import { User, UserRole } from '../../../shared/models/users'
36import { UserAdminFlag } from '../../../shared/models/users/user-flag.model'
37import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type'
38import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
24import { 39import {
25 isNoInstanceConfigWarningModal, 40 isNoInstanceConfigWarningModal,
26 isNoWelcomeModal, 41 isNoWelcomeModal,
@@ -42,33 +57,19 @@ import {
42 isUserWebTorrentEnabledValid 57 isUserWebTorrentEnabledValid
43} from '../../helpers/custom-validators/users' 58} from '../../helpers/custom-validators/users'
44import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto' 59import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto'
60import { DEFAULT_USER_THEME_NAME, NSFW_POLICY_TYPES } from '../../initializers/constants'
61import { clearCacheByUserId } from '../../lib/oauth-model'
62import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
63import { ActorModel } from '../activitypub/actor'
64import { ActorFollowModel } from '../activitypub/actor-follow'
45import { OAuthTokenModel } from '../oauth/oauth-token' 65import { OAuthTokenModel } from '../oauth/oauth-token'
46import { getSort, throwIfNotValid } from '../utils' 66import { getSort, throwIfNotValid } from '../utils'
67import { VideoModel } from '../video/video'
47import { VideoChannelModel } from '../video/video-channel' 68import { VideoChannelModel } from '../video/video-channel'
69import { VideoImportModel } from '../video/video-import'
48import { VideoPlaylistModel } from '../video/video-playlist' 70import { VideoPlaylistModel } from '../video/video-playlist'
49import { AccountModel } from './account' 71import { AccountModel } from './account'
50import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type'
51import { values } from 'lodash'
52import { DEFAULT_USER_THEME_NAME, NSFW_POLICY_TYPES } from '../../initializers/constants'
53import { clearCacheByUserId } from '../../lib/oauth-model'
54import { UserNotificationSettingModel } from './user-notification-setting' 72import { UserNotificationSettingModel } from './user-notification-setting'
55import { VideoModel } from '../video/video'
56import { ActorModel } from '../activitypub/actor'
57import { ActorFollowModel } from '../activitypub/actor-follow'
58import { VideoImportModel } from '../video/video-import'
59import { UserAdminFlag } from '../../../shared/models/users/user-flag.model'
60import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
61import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
62import * as Bluebird from 'bluebird'
63import {
64 MMyUserFormattable,
65 MUserDefault,
66 MUserFormattable,
67 MUserId,
68 MUserNotifSettingChannelDefault,
69 MUserWithNotificationSetting,
70 MVideoFullLight
71} from '@server/types/models'
72 73
73enum ScopeNames { 74enum ScopeNames {
74 FOR_ME_API = 'FOR_ME_API', 75 FOR_ME_API = 'FOR_ME_API',