lint fixes
This commit is contained in:
parent
90827ce4a8
commit
963f538728
@ -1,12 +1,12 @@
|
||||
import Koa from 'koa';
|
||||
import { performance } from 'perf_hooks';
|
||||
import { limiter } from './limiter.js';
|
||||
import Koa from 'koa';
|
||||
import { CacheableLocalUser, User } from '@/models/entities/user.js';
|
||||
import { AccessToken } from '@/models/entities/access-token.js';
|
||||
import { getIpHash } from '@/misc/get-ip-hash.js';
|
||||
import { limiter } from './limiter.js';
|
||||
import endpoints, { IEndpointMeta } from './endpoints.js';
|
||||
import { ApiError } from './error.js';
|
||||
import { apiLogger } from './logger.js';
|
||||
import { AccessToken } from '@/models/entities/access-token.js';
|
||||
import { getIpHash } from '@/misc/get-ip-hash.js';
|
||||
|
||||
const accessDenied = {
|
||||
message: 'Access denied.',
|
||||
@ -120,20 +120,20 @@ export default async (endpoint: string, user: CacheableLocalUser | null | undefi
|
||||
if (e instanceof ApiError) {
|
||||
throw e;
|
||||
} else {
|
||||
apiLogger.error(`Internal error occurred in ${ep.name}: ${e?.message}`, {
|
||||
apiLogger.error(`Internal error occurred in ${ep.name}: ${e.message}`, {
|
||||
ep: ep.name,
|
||||
ps: data,
|
||||
e: {
|
||||
message: e?.message,
|
||||
code: e?.name,
|
||||
stack: e?.stack,
|
||||
message: e.message,
|
||||
code: e.name,
|
||||
stack: e.stack,
|
||||
},
|
||||
});
|
||||
throw new ApiError(null, {
|
||||
e: {
|
||||
message: e?.message,
|
||||
code: e?.name,
|
||||
stack: e?.stack,
|
||||
message: e.message,
|
||||
code: e.name,
|
||||
stack: e.stack,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../define.js';
|
||||
import { Announcements, AnnouncementReads } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { makePaginationQuery } from '../common/make-pagination-query.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../define.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { DriveFiles } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['drive', 'account'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../define.js';
|
||||
import { createExportCustomEmojisJob } from '@/queue/index.js';
|
||||
import ms from 'ms';
|
||||
import { createExportCustomEmojisJob } from '@/queue/index.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MoreThan } from 'typeorm';
|
||||
import { USER_ONLINE_THRESHOLD } from '@/const.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import { MoreThan } from 'typeorm';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../define.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['account'],
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notifications, Followings, Mutings, Users } from '@/models/index.js';
|
||||
import { notificationTypes } from '@/types.js';
|
||||
import read from '@/services/note/read.js';
|
||||
import { readNotification } from '../../common/read-notification.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateMutedInstanceNotificationQuery } from '../../common/generate-muted-instance-query.js';
|
||||
import { Notifications, Followings, Mutings, Users } from '@/models/index.js';
|
||||
import { notificationTypes } from '@/types.js';
|
||||
import read from '@/services/note/read.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['account', 'notifications'],
|
||||
@ -67,7 +67,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
.where('users.isSuspended = TRUE');
|
||||
|
||||
const query = makePaginationQuery(Notifications.createQueryBuilder('notification'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`notification.notifieeId = :meId`, { meId: user.id })
|
||||
.andWhere('notification.notifieeId = :meId', { meId: user.id })
|
||||
.leftJoinAndSelect('notification.notifier', 'notifier')
|
||||
.leftJoinAndSelect('notification.note', 'note')
|
||||
.leftJoinAndSelect('notifier.avatar', 'notifierAvatar')
|
||||
@ -103,13 +103,13 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
}
|
||||
|
||||
if (ps.includeTypes && ps.includeTypes.length > 0) {
|
||||
query.andWhere(`notification.type IN (:...includeTypes)`, { includeTypes: ps.includeTypes });
|
||||
query.andWhere('notification.type IN (:...includeTypes)', { includeTypes: ps.includeTypes });
|
||||
} else if (ps.excludeTypes && ps.excludeTypes.length > 0) {
|
||||
query.andWhere(`notification.type NOT IN (:...excludeTypes)`, { excludeTypes: ps.excludeTypes });
|
||||
query.andWhere('notification.type NOT IN (:...excludeTypes)', { excludeTypes: ps.excludeTypes });
|
||||
}
|
||||
|
||||
if (ps.unreadOnly) {
|
||||
query.andWhere(`notification.isRead = false`);
|
||||
query.andWhere('notification.isRead = false');
|
||||
}
|
||||
|
||||
const notifications = await query.take(ps.limit).getMany();
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { IsNull, MoreThan } from 'typeorm';
|
||||
import config from '@/config/index.js';
|
||||
import define from '../define.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Ads, Emojis, Users } from '@/models/index.js';
|
||||
import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits.js';
|
||||
import { IsNull, MoreThan } from 'typeorm';
|
||||
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['meta'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { makePaginationQuery } from '../common/make-pagination-query.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
@ -34,8 +34,8 @@ export const paramDef = {
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`note.visibility = 'public'`)
|
||||
.andWhere(`note.localOnly = FALSE`)
|
||||
.andWhere('note.visibility = \'public\'')
|
||||
.andWhere('note.localOnly = FALSE')
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
.leftJoinAndSelect('user.banner', 'banner')
|
||||
@ -61,7 +61,7 @@ export default define(meta, paramDef, async (ps) => {
|
||||
}
|
||||
|
||||
if (ps.withFiles !== undefined) {
|
||||
query.andWhere(ps.withFiles ? `note.fileIds != '{}'` : `note.fileIds = '{}'`);
|
||||
query.andWhere(ps.withFiles ? 'note.fileIds != \'{}\'' : 'note.fileIds = \'{}\'');
|
||||
}
|
||||
|
||||
if (ps.poll !== undefined) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query.js';
|
||||
|
||||
@ -38,13 +38,13 @@ export const paramDef = {
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
.where(`note.replyId = :noteId`, { noteId: ps.noteId })
|
||||
.where('note.replyId = :noteId', { noteId: ps.noteId })
|
||||
.orWhere(new Brackets(qb => { qb
|
||||
.where(`note.renoteId = :noteId`, { noteId: ps.noteId })
|
||||
.where('note.renoteId = :noteId', { noteId: ps.noteId })
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
.where(`note.text IS NOT NULL`)
|
||||
.orWhere(`note.fileIds != '{}'`)
|
||||
.orWhere(`note.hasPoll = TRUE`);
|
||||
.where('note.text IS NOT NULL')
|
||||
.orWhere('note.fileIds != \'{}\'')
|
||||
.orWhere('note.hasPoll = TRUE');
|
||||
}));
|
||||
}));
|
||||
}))
|
||||
|
@ -1,8 +1,8 @@
|
||||
import define from '../../define.js';
|
||||
import { In } from 'typeorm';
|
||||
import { ClipNotes, Clips } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { In } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['clips', 'notes'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Note } from '@/models/entities/note.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { Note } from '@/models/entities/note.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import deleteNote from '@/services/note/delete.js';
|
||||
import define from '../../define.js';
|
||||
import ms from 'ms';
|
||||
import deleteNote from '@/services/note/delete.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NoteFavorites } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { NoteFavorites } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes', 'favorites'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NoteFavorites } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { NoteFavorites } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes', 'favorites'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
|
||||
export const meta = {
|
||||
@ -36,9 +36,9 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = Notes.createQueryBuilder('note')
|
||||
.addSelect('note.score')
|
||||
.where('note.userHost IS NULL')
|
||||
.andWhere(`note.score > 0`)
|
||||
.andWhere(`note.createdAt > :date`, { date: new Date(Date.now() - day) })
|
||||
.andWhere(`note.visibility = 'public'`)
|
||||
.andWhere('note.score > 0')
|
||||
.andWhere('note.createdAt > :date', { date: new Date(Date.now() - day) })
|
||||
.andWhere('note.visibility = \'public\'')
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
.leftJoinAndSelect('user.banner', 'banner')
|
||||
|
@ -1,11 +1,11 @@
|
||||
import define from '../../define.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import { generateRepliesQuery } from '../../common/generate-replies-query.js';
|
||||
import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
@ -60,7 +60,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
|
||||
//#region Construct query
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere('note.visibility = \'public\'')
|
||||
.andWhere('note.channelId IS NULL')
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
|
@ -1,13 +1,13 @@
|
||||
import define from '../../define.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Followings, Notes, Users } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Followings, Notes, Users } from '@/models/index.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import { generateRepliesQuery } from '../../common/generate-replies-query.js';
|
||||
import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js';
|
||||
import { generateChannelQuery } from '../../common/generate-channel-query.js';
|
||||
@ -70,7 +70,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
.where('following.followerId = :followerId', { followerId: user.id });
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(new Brackets(qb => {
|
||||
qb.where(`((note.userId IN (${ followingQuery.getQuery() })) OR (note.userId = :meId))`, { meId: user.id })
|
||||
.orWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)');
|
||||
|
@ -1,12 +1,12 @@
|
||||
import define from '../../define.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { generateRepliesQuery } from '../../common/generate-replies-query.js';
|
||||
import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js';
|
||||
import { generateChannelQuery } from '../../common/generate-channel-query.js';
|
||||
@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
|
||||
//#region Construct query
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)')
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
|
@ -1,10 +1,10 @@
|
||||
import define from '../../define.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import read from '@/services/note/read.js';
|
||||
import { Notes, Followings } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
import { generateMutedNoteThreadQuery } from '../../common/generate-muted-note-thread-query.js';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../../../define.js';
|
||||
import { Polls, Mutings, Notes, PollVotes } from '@/models/index.js';
|
||||
import { Brackets, In } from 'typeorm';
|
||||
import { Polls, Mutings, Notes, PollVotes } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
@ -31,8 +31,8 @@ export const paramDef = {
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = Polls.createQueryBuilder('poll')
|
||||
.where('poll.userHost IS NULL')
|
||||
.andWhere(`poll.userId != :meId`, { meId: user.id })
|
||||
.andWhere(`poll.noteVisibility = 'public'`)
|
||||
.andWhere('poll.userId != :meId', { meId: user.id })
|
||||
.andWhere('poll.noteVisibility = \'public\'')
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
.where('poll.expiresAt IS NULL')
|
||||
.orWhere('poll.expiresAt > :now', { now: new Date() });
|
||||
|
@ -1,16 +1,16 @@
|
||||
import { Not } from 'typeorm';
|
||||
import { publishNoteStream } from '@/services/stream.js';
|
||||
import { createNotification } from '@/services/create-notification.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { deliver } from '@/queue/index.js';
|
||||
import { renderActivity } from '@/remote/activitypub/renderer/index.js';
|
||||
import renderVote from '@/remote/activitypub/renderer/vote.js';
|
||||
import { deliverQuestionUpdate } from '@/services/note/polls/update.js';
|
||||
import { PollVotes, NoteWatchings, Users, Polls, Blockings } from '@/models/index.js';
|
||||
import { Not } from 'typeorm';
|
||||
import { IRemoteUser } from '@/models/entities/user.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../../../define.js';
|
||||
import ms from 'ms';
|
||||
import deleteReaction from '@/services/note/reaction/delete.js';
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
|
||||
export const meta = {
|
||||
@ -50,7 +50,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
});
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`note.renoteId = :renoteId`, { renoteId: note.id })
|
||||
.andWhere('note.renoteId = :renoteId', { renoteId: note.id })
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
.leftJoinAndSelect('user.banner', 'banner')
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
|
@ -1,11 +1,11 @@
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { safeForSql } from '@/misc/safe-for-sql.js';
|
||||
import { normalizeForSearch } from '@/misc/normalize-for-search.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { In } from 'typeorm';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import config from '@/config/index.js';
|
||||
import es from '../../../../db/elasticsearch.js';
|
||||
import define from '../../define.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { In } from 'typeorm';
|
||||
import config from '@/config/index.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
@ -99,7 +99,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
userHost: ps.host,
|
||||
},
|
||||
}] : []
|
||||
: [];
|
||||
: [];
|
||||
|
||||
const result = await es.search({
|
||||
index: config.elasticsearch.index || 'misskey_note',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { NoteFavorites, Notes, NoteThreadMutings, NoteWatchings } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { Notes, NoteThreadMutings } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import readNote from '@/services/note/read.js';
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NoteThreadMutings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { NoteThreadMutings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notes, Followings } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { Notes, Followings } from '@/models/index.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { generateRepliesQuery } from '../../common/generate-replies-query.js';
|
||||
import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js';
|
||||
import { generateChannelQuery } from '../../common/generate-channel-query.js';
|
||||
@ -62,10 +62,10 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
.where('following.followerId = :followerId', { followerId: user.id });
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
.where('note.userId = :meId', { meId: user.id });
|
||||
if (hasFollowing) qb.orWhere(`note.userId IN (${ followingQuery.getQuery() })`);
|
||||
if (hasFollowing) qb.orWhere(`note.userId IN (${ followingQuery.getQuery() })`);
|
||||
}))
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
|
@ -1,9 +1,9 @@
|
||||
import deleteNote from '@/services/note/delete.js';
|
||||
import define from '../../define.js';
|
||||
import ms from 'ms';
|
||||
import deleteNote from '@/services/note/delete.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { UserLists, UserListJoinings, Notes } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { UserLists, UserListJoinings, Notes } from '@/models/index.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes', 'lists'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../../define.js';
|
||||
import watch from '@/services/note/watch.js';
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../../define.js';
|
||||
import unwatch from '@/services/note/unwatch.js';
|
||||
import define from '../../../define.js';
|
||||
import { getNote } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { createNotification } from '@/services/create-notification.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notifications'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { publishMainStream } from '@/services/stream.js';
|
||||
import { pushNotification } from '@/services/push-notification.js';
|
||||
import define from '../../define.js';
|
||||
import { Notifications } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notifications', 'account'],
|
||||
|
@ -4,7 +4,7 @@ import { readNotification } from '../../common/read-notification.js';
|
||||
export const meta = {
|
||||
desc: {
|
||||
'ja-JP': '通知を既読にします。',
|
||||
'en-US': 'Mark a notification as read.'
|
||||
'en-US': 'Mark a notification as read.',
|
||||
},
|
||||
|
||||
tags: ['notifications', 'account'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../define.js';
|
||||
import { publishMainStream } from '@/services/stream.js';
|
||||
import { Users, Pages } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { ApiError } from '../error.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import ms from 'ms';
|
||||
import define from '../../define.js';
|
||||
import { Pages, DriveFiles } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { Page } from '@/models/entities/page.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
@ -51,7 +51,7 @@ export const paramDef = {
|
||||
} },
|
||||
script: { type: 'string' },
|
||||
eyeCatchingImageId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||
font: { type: 'string', enum: ['serif', 'sans-serif'], default: "sans-serif" },
|
||||
font: { type: 'string', enum: ['serif', 'sans-serif'], default: 'sans-serif' },
|
||||
alignCenter: { type: 'boolean', default: false },
|
||||
hideTitleWhenPinned: { type: 'boolean', default: false },
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Pages } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Pages } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { Pages } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Pages, PageLikes } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Pages, PageLikes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Pages, PageLikes } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import ms from 'ms';
|
||||
import { Not } from 'typeorm';
|
||||
import { Pages, DriveFiles } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Pages, DriveFiles } from '@/models/index.js';
|
||||
import { Not } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import define from '../define.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
import { Users } from '@/models/index.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import * as Acct from '@/misc/acct.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { PromoReads } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { getNote } from '../../common/getters.js';
|
||||
import { PromoReads } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { publishMainStream } from '@/services/stream.js';
|
||||
import define from '../define.js';
|
||||
import rndstr from 'rndstr';
|
||||
import config from '@/config/index.js';
|
||||
import ms from 'ms';
|
||||
import { IsNull } from 'typeorm';
|
||||
import { publishMainStream } from '@/services/stream.js';
|
||||
import config from '@/config/index.js';
|
||||
import { Users, UserProfiles, PasswordResetRequests } from '@/models/index.js';
|
||||
import { sendEmail } from '@/services/send-email.js';
|
||||
import { ApiError } from '../error.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
import { ApiError } from '../error.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['reset password'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { resetDb } from '@/db/postgre.js';
|
||||
import define from '../define.js';
|
||||
import { ApiError } from '../error.js';
|
||||
import { resetDb } from '@/db/postgre.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['non-productive'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { publishMainStream } from '@/services/stream.js';
|
||||
import define from '../define.js';
|
||||
import { Users, UserProfiles, PasswordResetRequests } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { ApiError } from '../error.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../define.js';
|
||||
import { Instances, NoteReactions, Notes, Users } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { } from '@/services/chart/index.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import define from '../../define.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { SwSubscriptions } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['account'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { SwSubscriptions } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['account'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../../define.js';
|
||||
import { Users, UsedUsernames } from '@/models/index.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
import { Users, UsedUsernames } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../define.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import define from '../define.js';
|
||||
import { generateMutedUserQueryForUsers } from '../common/generate-muted-user-query.js';
|
||||
import { generateBlockQueryForUsers } from '../common/generate-block-query.js';
|
||||
|
||||
@ -25,8 +25,8 @@ export const paramDef = {
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt'] },
|
||||
state: { type: 'string', enum: ['all', 'admin', 'moderator', 'adminOrModerator', 'alive'], default: "all" },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: "local" },
|
||||
state: { type: 'string', enum: ['all', 'admin', 'moderator', 'adminOrModerator', 'alive'], default: 'all' },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { Clips } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
|
||||
export const meta = {
|
||||
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = makePaginationQuery(Clips.createQueryBuilder('clip'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`clip.userId = :userId`, { userId: ps.userId })
|
||||
.andWhere('clip.userId = :userId', { userId: ps.userId })
|
||||
.andWhere('clip.isPublic = true');
|
||||
|
||||
const clips = await query
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { IsNull } from 'typeorm';
|
||||
import { Users, Followings, UserProfiles } from '@/models/index.js';
|
||||
import { toPunyNullable } from '@/misc/convert-host.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Users, Followings, UserProfiles } from '@/models/index.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { toPunyNullable } from '@/misc/convert-host.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
@ -96,7 +96,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
}
|
||||
|
||||
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`following.followeeId = :userId`, { userId: user.id })
|
||||
.andWhere('following.followeeId = :userId', { userId: user.id })
|
||||
.innerJoinAndSelect('following.follower', 'follower');
|
||||
|
||||
const followings = await query
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { IsNull } from 'typeorm';
|
||||
import { Users, Followings, UserProfiles } from '@/models/index.js';
|
||||
import { toPunyNullable } from '@/misc/convert-host.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Users, Followings, UserProfiles } from '@/models/index.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { toPunyNullable } from '@/misc/convert-host.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
@ -96,7 +96,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
}
|
||||
|
||||
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`following.followerId = :userId`, { userId: user.id })
|
||||
.andWhere('following.followerId = :userId', { userId: user.id })
|
||||
.innerJoinAndSelect('following.followee', 'followee');
|
||||
|
||||
const followings = await query
|
||||
|
@ -1,9 +1,9 @@
|
||||
import define from '../../define.js';
|
||||
import { Not, In, IsNull } from 'typeorm';
|
||||
import { maximum } from '@/prelude/array.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { getUser } from '../../common/getters.js';
|
||||
import { Not, In, IsNull } from 'typeorm';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import define from '../../../define.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { UserGroup } from '@/models/entities/user-group.js';
|
||||
import { UserGroupJoining } from '@/models/entities/user-group-joining.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserGroups } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserGroups } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import define from '../../../../define.js';
|
||||
import { ApiError } from '../../../../error.js';
|
||||
import { UserGroupJoinings, UserGroupInvitations } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { UserGroupJoining } from '@/models/entities/user-group-joining.js';
|
||||
import { ApiError } from '../../../../error.js';
|
||||
import define from '../../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserGroupInvitations } from '@/models/index.js';
|
||||
import define from '../../../../define.js';
|
||||
import { ApiError } from '../../../../error.js';
|
||||
import { UserGroupInvitations } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,10 +1,10 @@
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { UserGroups, UserGroupJoinings, UserGroupInvitations } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { UserGroupInvitation } from '@/models/entities/user-group-invitation.js';
|
||||
import { createNotification } from '@/services/create-notification.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import define from '../../../define.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import { Not, In } from 'typeorm';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'account'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../../define.js';
|
||||
import { UserGroups } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'account'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'account'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { UserGroups, UserGroupJoinings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups', 'users'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserGroups } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserGroups } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['groups'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import define from '../../../define.js';
|
||||
import { UserLists } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { UserList } from '@/models/entities/user-list.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserLists } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserLists } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../../define.js';
|
||||
import { UserLists } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists', 'account'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { publishUserListStream } from '@/services/stream.js';
|
||||
import { UserLists, UserListJoinings, Users } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { UserLists, UserListJoinings, Users } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists', 'users'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { pushUserToUserList } from '@/services/user-list/push.js';
|
||||
import { UserLists, UserListJoinings, Blockings } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { getUser } from '../../../common/getters.js';
|
||||
import { pushUserToUserList } from '@/services/user-list/push.js';
|
||||
import { UserLists, UserListJoinings, Blockings } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists', 'users'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserLists } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserLists } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists', 'account'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { UserLists } from '@/models/index.js';
|
||||
import define from '../../../define.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
import { UserLists } from '@/models/index.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['lists'],
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { getUser } from '../../common/getters.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { generateBlockedUserQuery } from '../../common/generate-block-query.js';
|
||||
import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { Pages } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
|
||||
export const meta = {
|
||||
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = makePaginationQuery(Pages.createQueryBuilder('page'), ps.sinceId, ps.untilId)
|
||||
.andWhere(`page.userId = :userId`, { userId: ps.userId })
|
||||
.andWhere('page.userId = :userId', { userId: ps.userId })
|
||||
.andWhere('page.visibility = \'public\'');
|
||||
|
||||
const pages = await query
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { NoteReactions, UserProfiles } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { makePaginationQuery } from '../../common/make-pagination-query.js';
|
||||
import { generateVisibilityQuery } from '../../common/generate-visibility-query.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
@ -52,8 +52,8 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
}
|
||||
|
||||
const query = makePaginationQuery(NoteReactions.createQueryBuilder('reaction'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(`reaction.userId = :userId`, { userId: ps.userId })
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere('reaction.userId = :userId', { userId: ps.userId })
|
||||
.leftJoinAndSelect('reaction.note', 'note');
|
||||
|
||||
generateVisibilityQuery(query, me);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import ms from 'ms';
|
||||
import define from '../../define.js';
|
||||
import { Users, Followings } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
import { generateMutedUserQueryForUsers } from '../../common/generate-muted-user-query.js';
|
||||
import { generateBlockedUserQuery, generateBlockQueryForUsers } from '../../common/generate-block-query.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import define from '../../define.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,12 +1,12 @@
|
||||
import * as sanitizeHtml from 'sanitize-html';
|
||||
import define from '../../define.js';
|
||||
import { publishAdminStream } from '@/services/stream.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { getUser } from '../../common/getters.js';
|
||||
import { AbuseUserReports, Users } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { sendEmail } from '@/services/send-email.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { getUser } from '../../common/getters.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import define from '../../define.js';
|
||||
import { Followings, Users } from '@/models/index.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Followings, Users } from '@/models/index.js';
|
||||
import { USER_ACTIVE_THRESHOLD } from '@/const.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
@ -67,7 +67,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
|
||||
const query = Users.createQueryBuilder('user')
|
||||
.where(`user.id IN (${ followingQuery.getQuery() })`)
|
||||
.andWhere(`user.id != :meId`, { meId: me.id })
|
||||
.andWhere('user.id != :meId', { meId: me.id })
|
||||
.andWhere('user.isSuspended = FALSE')
|
||||
.andWhere('user.usernameLower LIKE :username', { username: ps.username.toLowerCase() + '%' })
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
@ -85,7 +85,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
if (users.length < ps.limit) {
|
||||
const otherQuery = await Users.createQueryBuilder('user')
|
||||
.where(`user.id NOT IN (${ followingQuery.getQuery() })`)
|
||||
.andWhere(`user.id != :meId`, { meId: me.id })
|
||||
.andWhere('user.id != :meId', { meId: me.id })
|
||||
.andWhere('user.isSuspended = FALSE')
|
||||
.andWhere('user.usernameLower LIKE :username', { username: ps.username.toLowerCase() + '%' })
|
||||
.andWhere('user.updatedAt IS NOT NULL');
|
||||
|
@ -1,7 +1,7 @@
|
||||
import define from '../../define.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { UserProfiles, Users } from '@/models/index.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import define from '../../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
@ -27,7 +27,7 @@ export const paramDef = {
|
||||
query: { type: 'string' },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
origin: { type: 'string', enum: ['local', 'remote', 'combined'], default: "combined" },
|
||||
origin: { type: 'string', enum: ['local', 'remote', 'combined'], default: 'combined' },
|
||||
detail: { type: 'boolean', default: true },
|
||||
},
|
||||
required: ['query'],
|
||||
@ -113,7 +113,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
.orderBy('user.updatedAt', 'DESC', 'NULLS LAST')
|
||||
.take(ps.limit)
|
||||
.skip(ps.offset)
|
||||
.getMany()
|
||||
.getMany(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { FindOptionsWhere, In, IsNull } from 'typeorm';
|
||||
import { resolveUser } from '@/remote/resolve-user.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import define from '../../define.js';
|
||||
import { apiLogger } from '../../logger.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Users } from '@/models/index.js';
|
||||
import { FindOptionsWhere, In, IsNull } from 'typeorm';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { DriveFiles, Followings, NoteFavorites, NoteReactions, Notes, PageLikes, PollVotes, Users } from '@/models/index.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users'],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Limiter from 'ratelimiter';
|
||||
import { redisClient } from '../../db/redis.js';
|
||||
import { IEndpointMeta } from './endpoints.js';
|
||||
import { CacheableLocalUser, User } from '@/models/entities/user.js';
|
||||
import Logger from '@/services/logger.js';
|
||||
import { redisClient } from '../../db/redis.js';
|
||||
import { IEndpointMeta } from './endpoints.js';
|
||||
|
||||
const logger = new Logger('limiter');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user