clean up w/ rome
This commit is contained in:
parent
cc52292985
commit
abf47e54f3
|
@ -69,7 +69,7 @@ export function fromHtml(html: string, hashtagNames?: string[]): string {
|
|||
) {
|
||||
text += txt;
|
||||
// メンション
|
||||
} else if (txt.startsWith("@") && !(rel?.value.match(/^me /))) {
|
||||
} else if (txt.startsWith("@") && !rel?.value.match(/^me /)) {
|
||||
const part = txt.split("@");
|
||||
|
||||
if (part.length === 2 && href) {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
export function isDuplicateKeyValueError(e: unknown | Error): boolean {
|
||||
return (
|
||||
(e as Error).message?.startsWith("duplicate key value")
|
||||
);
|
||||
return (e as Error).message?.startsWith("duplicate key value");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
export function isUserRelated(note: any, ids: Set<string>): boolean {
|
||||
if (ids.has(note.userId)) return true; // note author is muted
|
||||
if (note.mentions?.some((user: string) => ids.has(user)))
|
||||
return true; // any of mentioned users are muted
|
||||
if (note.mentions?.some((user: string) => ids.has(user))) return true; // any of mentioned users are muted
|
||||
if (note.reply && isUserRelated(note.reply, ids)) return true; // also check reply target
|
||||
if (note.renote && isUserRelated(note.renote, ids)) return true; // also check renote target
|
||||
return false;
|
||||
|
|
|
@ -9,7 +9,7 @@ export async function awaitAll<T>(obj: Promiseable<T>): Promise<T> {
|
|||
|
||||
const resolvedValues = await Promise.all(
|
||||
values.map((value) =>
|
||||
!(value?.constructor ) || value.constructor.name !== "Object"
|
||||
!value?.constructor || value.constructor.name !== "Object"
|
||||
? value
|
||||
: awaitAll(value),
|
||||
),
|
||||
|
|
|
@ -85,8 +85,10 @@ export async function exportBlocking(
|
|||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName =
|
||||
`blocking-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.csv`;
|
||||
const fileName = `blocking-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.csv`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path,
|
||||
|
|
|
@ -108,8 +108,10 @@ export async function exportCustomEmojis(
|
|||
archiveStream.on("close", async () => {
|
||||
logger.succ(`Exported to: ${archivePath}`);
|
||||
|
||||
const fileName =
|
||||
`custom-emojis-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.zip`;
|
||||
const fileName = `custom-emojis-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.zip`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path: archivePath,
|
||||
|
|
|
@ -93,8 +93,10 @@ export async function exportFollowing(
|
|||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName =
|
||||
`following-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.csv`;
|
||||
const fileName = `following-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.csv`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path,
|
||||
|
|
|
@ -86,8 +86,10 @@ export async function exportMute(
|
|||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName =
|
||||
`mute-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.csv`;
|
||||
const fileName = `mute-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.csv`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path,
|
||||
|
|
|
@ -93,8 +93,10 @@ export async function exportNotes(
|
|||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName =
|
||||
`notes-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.json`;
|
||||
const fileName = `notes-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.json`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path,
|
||||
|
|
|
@ -61,8 +61,10 @@ export async function exportUserLists(
|
|||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName =
|
||||
`user-lists-${dateFormat(new Date(), "yyyy-MM-dd-HH-mm-ss")}.csv`;
|
||||
const fileName = `user-lists-${dateFormat(
|
||||
new Date(),
|
||||
"yyyy-MM-dd-HH-mm-ss",
|
||||
)}.csv`;
|
||||
const driveFile = await addFile({
|
||||
user,
|
||||
path,
|
||||
|
|
|
@ -34,7 +34,7 @@ export async function extractPollFromQuestion(
|
|||
);
|
||||
|
||||
const votes = question[multiple ? "anyOf" : "oneOf"]!.map(
|
||||
(x, i) => (x.replies?.totalItems) || x._misskey_votes || 0,
|
||||
(x, i) => x.replies?.totalItems || x._misskey_votes || 0,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -38,8 +38,7 @@ export async function renderPerson(user: ILocalUser) {
|
|||
attachment.push({
|
||||
type: "PropertyValue",
|
||||
name: field.name,
|
||||
value:
|
||||
field.value?.match(/^https?:/)
|
||||
value: field.value?.match(/^https?:/)
|
||||
? `<a href="${
|
||||
new URL(field.value).href
|
||||
}" rel="me nofollow noopener" target="_blank">${
|
||||
|
|
|
@ -24,17 +24,17 @@ export default async function (query: string): Promise<IWebFinger> {
|
|||
function genUrl(query: string) {
|
||||
if (query.match(/^https?:\/\//)) {
|
||||
const u = new URL(query);
|
||||
return (
|
||||
`${u.protocol}//${u.hostname}/.well-known/webfinger?${urlQuery({ resource: query })}`
|
||||
);
|
||||
return `${u.protocol}//${u.hostname}/.well-known/webfinger?${urlQuery({
|
||||
resource: query,
|
||||
})}`;
|
||||
}
|
||||
|
||||
const m = query.match(/^([^@]+)@(.*)/);
|
||||
if (m) {
|
||||
const hostname = m[2];
|
||||
return (
|
||||
`https://${hostname}/.well-known/webfinger?${urlQuery({ resource: `acct:${query}` })}`
|
||||
);
|
||||
return `https://${hostname}/.well-known/webfinger?${urlQuery({
|
||||
resource: `acct:${query}`,
|
||||
})}`;
|
||||
}
|
||||
|
||||
throw new Error(`Invalid query (${query})`);
|
||||
|
|
|
@ -92,9 +92,9 @@ function PEMString(pemBuffer: Buffer, type = "CERTIFICATE") {
|
|||
start += 64;
|
||||
}
|
||||
|
||||
return (
|
||||
`-----BEGIN ${type}-----\n${keyParts.join("\n")}\n-----END ${type}-----\n`
|
||||
);
|
||||
return `-----BEGIN ${type}-----\n${keyParts.join(
|
||||
"\n",
|
||||
)}\n-----END ${type}-----\n`;
|
||||
}
|
||||
|
||||
export function hash(data: Buffer) {
|
||||
|
|
|
@ -104,7 +104,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
AbuseUserReports.createQueryBuilder("report"),
|
||||
|
|
|
@ -30,7 +30,6 @@ export const paramDef = {
|
|||
required: ["username", "password"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, _me) => {
|
||||
const me = _me ? await Users.findOneByOrFail({ id: _me.id }) : null;
|
||||
const noUsers =
|
||||
|
|
|
@ -19,7 +19,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const hostedConfig = config.isManagedHosting;
|
||||
const hosted = hostedConfig != null && hostedConfig === true;
|
||||
|
|
|
@ -31,7 +31,6 @@ export const paramDef = {
|
|||
],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Ads.insert({
|
||||
id: genId(),
|
||||
|
|
|
@ -25,7 +25,6 @@ export const paramDef = {
|
|||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ad = await Ads.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
Ads.createQueryBuilder("ad"),
|
||||
|
|
|
@ -41,7 +41,6 @@ export const paramDef = {
|
|||
],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ad = await Ads.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ export const paramDef = {
|
|||
required: ["title", "text", "imageUrl"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const announcement = await Announcements.insert({
|
||||
id: genId(),
|
||||
|
|
|
@ -25,7 +25,6 @@ export const paramDef = {
|
|||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const announcement = await Announcements.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
Announcements.createQueryBuilder("announcement"),
|
||||
|
|
|
@ -28,7 +28,6 @@ export const paramDef = {
|
|||
required: ["id", "title", "text", "imageUrl"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const announcement = await Announcements.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneByOrFail({ id: ps.userId });
|
||||
if (user.isDeleted) {
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userId: ps.userId,
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["userId", "overrideMb"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
createCleanRemoteFilesJob();
|
||||
});
|
||||
|
|
|
@ -16,7 +16,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userId: IsNull(),
|
||||
|
|
|
@ -48,7 +48,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
DriveFiles.createQueryBuilder("file"),
|
||||
|
|
|
@ -195,7 +195,6 @@ export const paramDef = {
|
|||
],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const file = ps.fileId
|
||||
? await DriveFiles.findOneBy({ id: ps.fileId })
|
||||
|
|
|
@ -31,7 +31,6 @@ export const paramDef = {
|
|||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
|
|
@ -30,7 +30,6 @@ export const paramDef = {
|
|||
required: ["fileId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const file = await DriveFiles.findOneBy({ id: ps.fileId });
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ export const paramDef = {
|
|||
required: ["emojiId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.emojiId });
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ export const paramDef = {
|
|||
required: ["ids"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
|
|
@ -27,7 +27,6 @@ export const paramDef = {
|
|||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ export const paramDef = {
|
|||
required: ["fileId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
createImportCustomEmojisJob(user, ps.fileId);
|
||||
});
|
||||
|
|
|
@ -77,7 +77,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const q = makePaginationQuery(
|
||||
Emojis.createQueryBuilder("emoji"),
|
||||
|
|
|
@ -71,7 +71,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const q = makePaginationQuery(
|
||||
Emojis.createQueryBuilder("emoji"),
|
||||
|
|
|
@ -31,7 +31,6 @@ export const paramDef = {
|
|||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
|
|
@ -31,7 +31,6 @@ export const paramDef = {
|
|||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Emojis.update(
|
||||
{
|
||||
|
|
|
@ -30,7 +30,6 @@ export const paramDef = {
|
|||
required: ["ids"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Emojis.update(
|
||||
{
|
||||
|
|
|
@ -38,7 +38,6 @@ export const paramDef = {
|
|||
required: ["id", "name", "aliases"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.id });
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userHost: ps.host,
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await Instances.findOneBy({ host: toPuny(ps.host) });
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const followings = await Followings.findBy({
|
||||
followerHost: ps.host,
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["host", "isSuspended"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await Instances.findOneBy({ host: toPuny(ps.host) });
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const stats = await db.query("SELECT * FROM pg_indexes;").then((recs) => {
|
||||
const res = [] as { tablename: string; indexname: string }[];
|
||||
|
|
|
@ -26,7 +26,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const sizes = await db
|
||||
.query(`
|
||||
|
|
|
@ -16,7 +16,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ips = await UserIps.find({
|
||||
where: { userId: ps.userId },
|
||||
|
|
|
@ -32,7 +32,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const code = rndstr({
|
||||
length: 8,
|
||||
|
|
|
@ -465,7 +465,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await fetchMeta(true);
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ export const paramDef = {
|
|||
required: ["noteId", "expiresAt"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const note = await getNote(ps.noteId, user).catch((err) => {
|
||||
if (err.id === "9725d0ce-ba28-4dde-95a7-2cbb2c15de24")
|
||||
|
|
|
@ -15,7 +15,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
destroy();
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const jobs = await deliverQueue.getJobs(["delayed"]);
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const jobs = await inboxQueue.getJobs(["delayed"]);
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const deliverJobCounts = await deliverQueue.getJobCounts();
|
||||
const inboxJobCounts = await inboxQueue.getJobCounts();
|
||||
|
|
|
@ -54,7 +54,6 @@ export const paramDef = {
|
|||
required: ["inbox"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
try {
|
||||
if (new URL(ps.inbox).protocol !== "https:") throw new Error("https only");
|
||||
|
|
|
@ -46,7 +46,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
return await listRelay();
|
||||
});
|
||||
|
|
|
@ -16,7 +16,6 @@ export const paramDef = {
|
|||
required: ["inbox"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
return await removeRelay(ps.inbox);
|
||||
});
|
||||
|
|
|
@ -33,7 +33,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ export const paramDef = {
|
|||
required: ["reportId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const report = await AbuseUserReports.findOneByOrFail({ id: ps.reportId });
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["to", "subject", "text"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await sendEmail(ps.to, ps.subject, ps.text, ps.text);
|
||||
});
|
||||
|
|
|
@ -108,7 +108,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const memStats = await si.mem();
|
||||
const fsStats = await si.fsSize();
|
||||
|
|
|
@ -66,7 +66,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
ModerationLogs.createQueryBuilder("report"),
|
||||
|
|
|
@ -22,7 +22,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const [user, profile] = await Promise.all([
|
||||
Users.findOneBy({ id: ps.userId }),
|
||||
|
|
|
@ -66,7 +66,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = Users.createQueryBuilder("user");
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const set = {} as Partial<Meta>;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ export const paramDef = {
|
|||
required: ["userId", "text"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ export const paramDef = {
|
|||
required: ["full", "analyze"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const params: string[] = [];
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = makePaginationQuery(
|
||||
Announcements.createQueryBuilder("announcement"),
|
||||
|
|
|
@ -82,7 +82,6 @@ export const paramDef = {
|
|||
],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
if (user.movedToUri != null) throw new ApiError(meta.errors.noSuchUserGroup);
|
||||
let userList;
|
||||
|
|
|
@ -27,7 +27,6 @@ export const paramDef = {
|
|||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
id: ps.antennaId,
|
||||
|
|
|
@ -27,7 +27,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const antennas = await Antennas.findBy({
|
||||
userId: me.id,
|
||||
|
|
|
@ -19,7 +19,6 @@ export const paramDef = {
|
|||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
userId: me.id,
|
||||
|
|
|
@ -48,7 +48,6 @@ export const paramDef = {
|
|||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
id: ps.antennaId,
|
||||
|
|
|
@ -33,7 +33,6 @@ export const paramDef = {
|
|||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
// Fetch the antenna
|
||||
const antenna = await Antennas.findOneBy({
|
||||
|
|
|
@ -89,7 +89,6 @@ export const paramDef = {
|
|||
],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Fetch the antenna
|
||||
const antenna = await Antennas.findOneBy({
|
||||
|
|
|
@ -29,7 +29,6 @@ export const paramDef = {
|
|||
required: ["uri"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const resolver = new Resolver();
|
||||
const object = await resolver.resolve(ps.uri);
|
||||
|
|
|
@ -83,7 +83,6 @@ export const paramDef = {
|
|||
required: ["uri"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const object = await fetchAny(ps.uri, me);
|
||||
if (object) {
|
||||
|
|
|
@ -34,7 +34,6 @@ export const paramDef = {
|
|||
required: ["name", "description", "permission"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
if (user?.movedToUri != null)
|
||||
return await Apps.pack("", null, {
|
||||
|
|
|
@ -29,7 +29,6 @@ export const paramDef = {
|
|||
required: ["appId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user, token) => {
|
||||
const isSecure = user != null && token == null;
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ export const paramDef = {
|
|||
required: ["token"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Fetch token
|
||||
const session = await AuthSessions.findOneBy({ token: ps.token });
|
||||
|
|
|
@ -46,7 +46,6 @@ export const paramDef = {
|
|||
required: ["appSecret"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
// Lookup app
|
||||
const app = await Apps.findOneBy({
|
||||
|
|
|
@ -49,7 +49,6 @@ export const paramDef = {
|
|||
required: ["token"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Lookup session
|
||||
const session = await AuthSessions.findOneBy({
|
||||
|
|
|
@ -57,7 +57,6 @@ export const paramDef = {
|
|||
required: ["appSecret", "token"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
// Lookup app
|
||||
const app = await Apps.findOneBy({
|
||||
|
|
|
@ -53,7 +53,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const blocker = await Users.findOneByOrFail({ id: user.id });
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ export const paramDef = {
|
|||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const blocker = await Users.findOneByOrFail({ id: user.id });
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
Blockings.createQueryBuilder("blocking"),
|
||||
|
|
|
@ -42,7 +42,6 @@ export const paramDef = {
|
|||
required: ["name"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
let banner = null;
|
||||
if (ps.bannerId != null) {
|
||||
|
|
|
@ -26,7 +26,6 @@ export const paramDef = {
|
|||
required: [],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = Channels.createQueryBuilder("channel")
|
||||
.where("channel.lastNotedAt IS NOT NULL")
|
||||
|
|
|
@ -28,7 +28,6 @@ export const paramDef = {
|
|||
required: ["channelId"],
|
||||
} as const;
|
||||
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const channel = await Channels.findOneBy({
|
||||
id: ps.channelId,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue