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

View file

@ -110,6 +110,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const query = makePaginationQuery(AbuseUserReports.createQueryBuilder('report'), ps.sinceId, ps.untilId);

View file

@ -28,6 +28,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, _me) => {
const me = _me ? await Users.findOneOrFail(_me.id) : null;
const noUsers = (await Users.count({

View file

@ -19,6 +19,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId);

View file

@ -34,6 +34,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
await Ads.insert({
id: genId(),

View file

@ -25,6 +25,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const ad = await Ads.findOne(ps.id);

View file

@ -26,6 +26,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const query = makePaginationQuery(Ads.createQueryBuilder('ad'), ps.sinceId, ps.untilId)
.andWhere('ad.expiresAt > :now', { now: new Date() });

View file

@ -46,6 +46,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const ad = await Ads.findOne(ps.id);

View file

@ -57,6 +57,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const announcement = await Announcements.save({
id: genId(),

View file

@ -25,6 +25,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const announcement = await Announcements.findOne(ps.id);

View file

@ -69,6 +69,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const query = makePaginationQuery(Announcements.createQueryBuilder('announcement'), ps.sinceId, ps.untilId);

View file

@ -34,6 +34,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const announcement = await Announcements.findOne(ps.id);

View file

@ -17,6 +17,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const files = await DriveFiles.find({
userId: ps.userId,

View file

@ -8,6 +8,7 @@ export const meta = {
requireModerator: true,
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
await Logs.clear(); // TRUNCATE
});

View file

@ -8,6 +8,7 @@ export const meta = {
requireModerator: true,
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
createCleanRemoteFilesJob();
});

View file

@ -10,6 +10,7 @@ export const meta = {
requireModerator: true,
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const files = await DriveFiles.find({
userId: IsNull(),

View file

@ -54,6 +54,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = makePaginationQuery(DriveFiles.createQueryBuilder('file'), ps.sinceId, ps.untilId);

View file

@ -161,6 +161,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const file = ps.fileId ? await DriveFiles.findOne(ps.fileId) : await DriveFiles.findOne({
where: [{

View file

@ -30,6 +30,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const file = await DriveFiles.findOne(ps.fileId);

View file

@ -42,6 +42,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const emoji = await Emojis.findOne(ps.emojiId);

View file

@ -77,6 +77,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const q = makePaginationQuery(Emojis.createQueryBuilder('emoji'), ps.sinceId, ps.untilId);

View file

@ -72,6 +72,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const q = makePaginationQuery(Emojis.createQueryBuilder('emoji'), ps.sinceId, ps.untilId)
.andWhere(`emoji.host IS NULL`);

View file

@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const emoji = await Emojis.findOne(ps.id);

View file

@ -38,6 +38,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const emoji = await Emojis.findOne(ps.id);

View file

@ -16,6 +16,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const files = await DriveFiles.find({
userHost: ps.host,

View file

@ -17,6 +17,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const instance = await Instances.findOne({ host: toPuny(ps.host) });

View file

@ -16,6 +16,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const followings = await Followings.find({
followerHost: ps.host,

View file

@ -20,6 +20,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const instance = await Instances.findOne({ host: toPuny(ps.host) });

View file

@ -11,6 +11,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async () => {
const stats = await
getConnection().query(`SELECT * FROM pg_indexes;`)

View file

@ -22,6 +22,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async () => {
const sizes = await
getConnection().query(`

View file

@ -26,6 +26,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async () => {
const code = rndstr({
length: 8,

View file

@ -16,6 +16,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -16,6 +16,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -36,6 +36,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);

View file

@ -11,6 +11,7 @@ export const meta = {
params: {},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
destroy();

View file

@ -35,6 +35,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const jobs = await deliverQueue.getJobs(['delayed']);

View file

@ -35,6 +35,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const jobs = await inboxQueue.getJobs(['delayed']);

View file

@ -56,6 +56,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const queue =
ps.domain === 'deliver' ? deliverQueue :

View file

@ -29,6 +29,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const deliverJobCounts = await deliverQueue.getJobCounts();
const inboxJobCounts = await inboxQueue.getJobCounts();

View file

@ -52,6 +52,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
try {
if (new URL(ps.inbox).protocol !== 'https:') throw 'https only';

View file

@ -42,6 +42,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
return await listRelay();
});

View file

@ -15,6 +15,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
return await removeRelay(ps.inbox);
});

View file

@ -31,6 +31,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -16,6 +16,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const report = await AbuseUserReports.findOne(ps.reportId);

View file

@ -9,6 +9,7 @@ export const meta = {
requireModerator: true,
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
insertModerationLog(me, 'chartResync');

View file

@ -21,6 +21,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
await sendEmail(ps.to, ps.subject, ps.text, ps.text);
});

View file

@ -90,6 +90,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async () => {
const memStats = await si.mem();
const fsStats = await si.fsSize();

View file

@ -65,6 +65,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const query = makePaginationQuery(ModerationLogs.createQueryBuilder('report'), ps.sinceId, ps.untilId);

View file

@ -159,6 +159,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -74,6 +74,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = Users.createQueryBuilder('user');

View file

@ -17,6 +17,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -21,6 +21,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -17,6 +17,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -18,6 +18,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const user = await Users.findOne(ps.userId as string);

View file

@ -299,6 +299,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const set = {} as Partial<Meta>;

View file

@ -19,6 +19,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const params: string[] = [];

View file

@ -73,6 +73,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const query = makePaginationQuery(Announcements.createQueryBuilder('announcement'), ps.sinceId, ps.untilId);

View file

@ -80,6 +80,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
let userList;
let userGroupJoining;

View file

@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const antenna = await Antennas.findOne({
id: ps.antennaId,

View file

@ -19,6 +19,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const antennas = await Antennas.find({
userId: me.id,

View file

@ -62,6 +62,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const antenna = await Antennas.findOne({
id: ps.antennaId,

View file

@ -32,6 +32,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
// Fetch the antenna
const antenna = await Antennas.findOne({

View file

@ -89,6 +89,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Fetch the antenna
const antenna = await Antennas.findOne({

View file

@ -29,6 +29,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const resolver = new Resolver();
const object = await resolver.resolve(ps.uri);

View file

@ -54,6 +54,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const object = await fetchAny(ps.uri);
if (object) {

View file

@ -37,6 +37,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Generate secret
const secret = secureRndstr(32, true);

View file

@ -34,6 +34,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user, token) => {
const isSecure = user != null && token == null;

View file

@ -28,6 +28,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Fetch token
const session = await AuthSessions

View file

@ -42,6 +42,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
// Lookup app
const app = await Apps.findOne({

View file

@ -44,6 +44,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
// Lookup session
const session = await AuthSessions.findOne({

View file

@ -56,6 +56,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
// Lookup app
const app = await Apps.findOne({

View file

@ -52,6 +52,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const blocker = await Users.findOneOrFail(user.id);

View file

@ -52,6 +52,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const blocker = await Users.findOneOrFail(user.id);

View file

@ -37,6 +37,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = makePaginationQuery(Blockings.createQueryBuilder('blocking'), ps.sinceId, ps.untilId)
.andWhere(`blocking.blockerId = :meId`, { meId: me.id });

View file

@ -42,6 +42,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
let banner = null;
if (ps.bannerId != null) {

View file

@ -17,6 +17,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = Channels.createQueryBuilder('channel')
.where('channel.lastNotedAt IS NOT NULL')

View file

@ -28,6 +28,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const channel = await Channels.findOne({
id: ps.channelId,

View file

@ -37,6 +37,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = makePaginationQuery(ChannelFollowings.createQueryBuilder(), ps.sinceId, ps.untilId)
.andWhere({ followerId: me.id });

View file

@ -37,6 +37,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const query = makePaginationQuery(Channels.createQueryBuilder(), ps.sinceId, ps.untilId)
.andWhere({ userId: me.id });

View file

@ -30,6 +30,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const channel = await Channels.findOne({
id: ps.channelId,

View file

@ -57,6 +57,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const channel = await Channels.findOne({
id: ps.channelId,

View file

@ -27,6 +27,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const channel = await Channels.findOne({
id: ps.channelId,

View file

@ -56,6 +56,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const channel = await Channels.findOne({
id: ps.channelId,

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(activeUsersChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await activeUsersChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(driveChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await driveChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(federationChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await federationChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -29,6 +29,7 @@ export const meta = {
res: convertLog(hashtagChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await hashtagChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.tag);
});

View file

@ -29,6 +29,7 @@ export const meta = {
res: convertLog(instanceChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await instanceChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.host);
});

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(networkChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await networkChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(notesChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await notesChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -30,6 +30,7 @@ export const meta = {
res: convertLog(perUserDriveChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View file

@ -30,6 +30,7 @@ export const meta = {
res: convertLog(perUserFollowingChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View file

@ -30,6 +30,7 @@ export const meta = {
res: convertLog(perUserNotesChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View file

@ -30,6 +30,7 @@ export const meta = {
res: convertLog(perUserReactionsChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View file

@ -25,6 +25,7 @@ export const meta = {
res: convertLog(usersChart.schema),
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
return await usersChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View file

@ -44,6 +44,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const clip = await Clips.findOne({
id: ps.clipId,

View file

@ -31,6 +31,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const clip = await Clips.insert({
id: genId(),

View file

@ -26,6 +26,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const clip = await Clips.findOne({
id: ps.clipId,

View file

@ -19,6 +19,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
const clips = await Clips.find({
userId: me.id,

View file

@ -53,6 +53,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, user) => {
const clip = await Clips.findOne({
id: ps.clipId,

View file

@ -32,6 +32,7 @@ export const meta = {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps, me) => {
// Fetch the clip
const clip = await Clips.findOne({

Some files were not shown because too many files have changed in this diff Show more