Merge branch 'develop' into sw-notification-action
This commit is contained in:
@@ -22,7 +22,7 @@ export function generateVisibilityQuery(q: SelectQueryBuilder<any>, me?: { id: U
|
||||
// または 自分自身
|
||||
.orWhere('note.userId = :userId1', { userId1: me.id })
|
||||
// または 自分宛て
|
||||
.orWhere(':userId2 = ANY(note.visibleUserIds)', { userId2: me.id })
|
||||
.orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`)
|
||||
.orWhere(new Brackets(qb => { qb
|
||||
// または フォロワー宛ての投稿であり、
|
||||
.where('note.visibility = \'followers\'')
|
||||
|
@@ -22,6 +22,9 @@ export const meta = {
|
||||
priority: {
|
||||
validator: $.str
|
||||
},
|
||||
ratio: {
|
||||
validator: $.num.int().min(0)
|
||||
},
|
||||
expiresAt: {
|
||||
validator: $.num.int()
|
||||
},
|
||||
@@ -39,6 +42,7 @@ export default define(meta, async (ps) => {
|
||||
url: ps.url,
|
||||
imageUrl: ps.imageUrl,
|
||||
priority: ps.priority,
|
||||
ratio: ps.ratio,
|
||||
place: ps.place,
|
||||
memo: ps.memo,
|
||||
});
|
||||
|
@@ -29,6 +29,9 @@ export const meta = {
|
||||
priority: {
|
||||
validator: $.str
|
||||
},
|
||||
ratio: {
|
||||
validator: $.num.int().min(0)
|
||||
},
|
||||
expiresAt: {
|
||||
validator: $.num.int()
|
||||
},
|
||||
@@ -52,6 +55,7 @@ export default define(meta, async (ps, me) => {
|
||||
url: ps.url,
|
||||
place: ps.place,
|
||||
priority: ps.priority,
|
||||
ratio: ps.ratio,
|
||||
memo: ps.memo,
|
||||
imageUrl: ps.imageUrl,
|
||||
expiresAt: new Date(ps.expiresAt),
|
||||
|
26
src/server/api/endpoints/admin/get-index-stats.ts
Normal file
26
src/server/api/endpoints/admin/get-index-stats.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import define from '../../define';
|
||||
import { getConnection } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true as const,
|
||||
requireModerator: true,
|
||||
|
||||
tags: ['admin'],
|
||||
|
||||
params: {
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async () => {
|
||||
const stats = await
|
||||
getConnection().query(`SELECT * FROM pg_indexes;`)
|
||||
.then(recs => {
|
||||
const res = [] as { tablename: string; indexname: string; }[];
|
||||
for (const rec of recs) {
|
||||
res.push(rec);
|
||||
}
|
||||
return res;
|
||||
});
|
||||
|
||||
return stats;
|
||||
});
|
@@ -509,9 +509,10 @@ export default define(meta, async (ps, me) => {
|
||||
maxNoteTextLength: Math.min(instance.maxNoteTextLength, DB_MAX_NOTE_TEXT_LENGTH),
|
||||
emojis: await Emojis.packMany(emojis),
|
||||
ads: ads.map(ad => ({
|
||||
id: ad.id,
|
||||
url: ad.url,
|
||||
place: ad.place,
|
||||
priority: ad.priority,
|
||||
ratio: ad.ratio,
|
||||
imageUrl: ad.imageUrl,
|
||||
})),
|
||||
enableEmail: instance.enableEmail,
|
||||
|
@@ -60,8 +60,8 @@ export default define(meta, async (ps, user) => {
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
.andWhere(new Brackets(qb => { qb
|
||||
.where(`:meId = ANY(note.mentions)`, { meId: user.id })
|
||||
.orWhere(`:meId = ANY(note.visibleUserIds)`, { meId: user.id });
|
||||
.where(`'{"${user.id}"}' <@ note.mentions`)
|
||||
.orWhere(`'{"${user.id}"}' <@ note.visibleUserIds`);
|
||||
}))
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('note.reply', 'reply')
|
||||
|
Reference in New Issue
Block a user