1
0
This commit is contained in:
syuilo
2022-01-03 02:12:50 +09:00
parent 408142647c
commit 4a64280a7c
306 changed files with 306 additions and 0 deletions
@@ -44,6 +44,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
.andWhere(new Brackets(qb => { qb
@@ -36,6 +36,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -46,6 +46,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -175,6 +175,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
let visibleUsers: User[] = [];
if (ps.visibleUserIds) {
@@ -41,6 +41,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -34,6 +34,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Get favoritee
const note = await getNote(ps.noteId).catch(e => {
@@ -33,6 +33,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Get favoritee
const note = await getNote(ps.noteId).catch(e => {
@@ -32,6 +32,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const max = 30;
const day = 1000 * 60 * 60 * 24 * 3; // 3日前まで
@@ -61,6 +61,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const m = await fetchMeta();
if (m.disableGlobalTimeline) {
@@ -81,6 +81,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const m = await fetchMeta();
if (m.disableLocalTimeline && !user.isAdmin && !user.isModerator) {
@@ -72,6 +72,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const m = await fetchMeta();
if (m.disableLocalTimeline) {
@@ -50,6 +50,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const followingQuery = Followings.createQueryBuilder('following')
.select('following.followeeId')
@@ -31,6 +31,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const query = Polls.createQueryBuilder('poll')
.where('poll.userHost IS NULL')
@@ -70,6 +70,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const createdAt = new Date();
@@ -59,6 +59,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -43,6 +43,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -40,6 +40,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -52,6 +52,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -42,6 +42,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
.andWhere('note.replyId = :replyId', { replyId: ps.noteId })
@@ -66,6 +66,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
.innerJoinAndSelect('note.user', 'user')
@@ -63,6 +63,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
if (es == null) {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId);
@@ -31,6 +31,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -34,6 +34,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await Notes.findOneOrFail(ps.noteId);
@@ -29,6 +29,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -71,6 +71,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const hasFollowing = (await Followings.count({
where: {
@@ -38,6 +38,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -35,6 +35,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -78,6 +78,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const list = await UserLists.findOne({
id: ps.listId,
@@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
@@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const note = await getNote(ps.noteId).catch(e => {
if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);