mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-21 19:53:50 +01:00
no more eslint
This commit is contained in:
parent
2aab2de38d
commit
ac64087a1e
@ -1,4 +1,4 @@
|
||||
{
|
||||
"eslint.packageManager": "pnpm",
|
||||
"workspace.workspaceFolderCheckCwd": false,
|
||||
"workspace.workspaceFolderCheckCwd": false
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ pipeline:
|
||||
image: node:latest
|
||||
commands:
|
||||
- cp .config/ci.yml .config/default.yml
|
||||
- npm i -g pnpm
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@latest --activate
|
||||
- pnpm i --frozen-lockfile
|
||||
- pnpm run build
|
||||
- pnpm run migrate
|
||||
|
@ -10,7 +10,8 @@ RUN apk update
|
||||
RUN apk add git ffmpeg tini alpine-sdk python3
|
||||
|
||||
# Configure corepack and pnpm
|
||||
RUN npm i -g pnpm
|
||||
RUN corepack enable
|
||||
RUN corepack prepare pnpm@latest --activate
|
||||
RUN pnpm i --frozen-lockfile
|
||||
ARG NODE_ENV=production
|
||||
|
||||
|
@ -101,7 +101,8 @@ cd calckey/
|
||||
|
||||
```sh
|
||||
# nvm install 19 && nvm use 19
|
||||
npm i -g pnpm
|
||||
corepack enable
|
||||
corepack prepare pnpm@latest --activate
|
||||
pnpm i
|
||||
```
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
|
@ -40,7 +40,6 @@
|
||||
"@bull-board/ui": "^4.10.2",
|
||||
"@tensorflow/tfjs": "^3.21.0",
|
||||
"calckey-js": "^0.0.20",
|
||||
"eslint": "^8.31.0",
|
||||
"execa": "5.1.1",
|
||||
"gulp": "4.0.2",
|
||||
"gulp-cssnano": "2.1.3",
|
||||
@ -55,13 +54,11 @@
|
||||
"devDependencies": {
|
||||
"@types/gulp": "4.0.10",
|
||||
"@types/gulp-rename": "2.0.1",
|
||||
"@typescript-eslint/parser": "5.46.1",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "10.11.0",
|
||||
"install-peers": "^1.0.4",
|
||||
"rome": "^11.0.0",
|
||||
"start-server-and-test": "1.15.2",
|
||||
"typescript": "4.9.4",
|
||||
"vue-eslint-parser": "^9.1.0"
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
"revertmigration": "typeorm migration:revert -d ormconfig.js",
|
||||
"build": "pnpm swc src -d built -D",
|
||||
"watch": "pnpm swc src -d built -D -w",
|
||||
"lint": "pnpm eslint --quiet \"src/**/*.ts\"",
|
||||
"lint": "pnpm rome check \"src/**/*.ts\"",
|
||||
"mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
|
||||
"test": "pnpm run mocha"
|
||||
},
|
||||
@ -178,11 +178,7 @@
|
||||
"@types/web-push": "3.3.2",
|
||||
"@types/websocket": "1.0.5",
|
||||
"@types/ws": "8.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "5.46.1",
|
||||
"@typescript-eslint/parser": "5.46.1",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "8.31.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"execa": "6.1.0",
|
||||
"swc-loader": "^0.2.3",
|
||||
"typescript": "4.9.4",
|
||||
|
@ -66,7 +66,6 @@ export function genIdenticon(seed: string, stream: WriteStream): Promise<void> {
|
||||
// 1*n (filled by false)
|
||||
const center: boolean[] = new Array(n).fill(false);
|
||||
|
||||
// eslint:disable-next-line:prefer-for-of
|
||||
for (let x = 0; x < side.length; x++) {
|
||||
for (let y = 0; y < side[x].length; y++) {
|
||||
side[x][y] = rand(3) === 0;
|
||||
|
@ -300,14 +300,12 @@ async function* asyncIterateFrames(
|
||||
});
|
||||
command.run();
|
||||
for (let i = 1; true; i++) {
|
||||
// eslint-disable-line @typescript-eslint/no-unnecessary-condition
|
||||
const current = `${i}.png`;
|
||||
const next = `${i + 1}.png`;
|
||||
const framePath = join(cwd, current);
|
||||
if (await exists(join(cwd, next))) {
|
||||
yield framePath;
|
||||
} else if (!finished) {
|
||||
// eslint-disable-line @typescript-eslint/no-unnecessary-condition
|
||||
watcher.add(next);
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
watcher.on("add", function onAdd(path) {
|
||||
|
@ -104,7 +104,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
AbuseUserReports.createQueryBuilder("report"),
|
||||
|
@ -30,7 +30,7 @@ export const paramDef = {
|
||||
required: ["username", "password"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, _me) => {
|
||||
const me = _me ? await Users.findOneByOrFail({ id: _me.id }) : null;
|
||||
const noUsers =
|
||||
|
@ -19,7 +19,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const hostedConfig = config.isManagedHosting;
|
||||
const hosted = hostedConfig != null && hostedConfig === true;
|
||||
|
@ -31,7 +31,7 @@ export const paramDef = {
|
||||
],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Ads.insert({
|
||||
id: genId(),
|
||||
|
@ -25,7 +25,7 @@ export const paramDef = {
|
||||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ad = await Ads.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -19,7 +19,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
Ads.createQueryBuilder("ad"),
|
||||
|
@ -41,7 +41,7 @@ export const paramDef = {
|
||||
],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ad = await Ads.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -61,7 +61,7 @@ export const paramDef = {
|
||||
required: ["title", "text", "imageUrl"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const announcement = await Announcements.insert({
|
||||
id: genId(),
|
||||
|
@ -25,7 +25,7 @@ export const paramDef = {
|
||||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const announcement = await Announcements.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -72,7 +72,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
Announcements.createQueryBuilder("announcement"),
|
||||
|
@ -28,7 +28,7 @@ export const paramDef = {
|
||||
required: ["id", "title", "text", "imageUrl"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const announcement = await Announcements.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -19,7 +19,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneByOrFail({ id: ps.userId });
|
||||
if (user.isDeleted) {
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userId: ps.userId,
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["userId", "overrideMb"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -14,7 +14,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
createCleanRemoteFilesJob();
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userId: IsNull(),
|
||||
|
@ -48,7 +48,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
DriveFiles.createQueryBuilder("file"),
|
||||
|
@ -195,7 +195,7 @@ export const paramDef = {
|
||||
],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const file = ps.fileId
|
||||
? await DriveFiles.findOneBy({ id: ps.fileId })
|
||||
|
@ -31,7 +31,7 @@ export const paramDef = {
|
||||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
@ -30,7 +30,7 @@ export const paramDef = {
|
||||
required: ["fileId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const file = await DriveFiles.findOneBy({ id: ps.fileId });
|
||||
|
||||
|
@ -44,7 +44,7 @@ export const paramDef = {
|
||||
required: ["emojiId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.emojiId });
|
||||
|
||||
|
@ -26,7 +26,7 @@ export const paramDef = {
|
||||
required: ["ids"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
@ -27,7 +27,7 @@ export const paramDef = {
|
||||
required: ["id"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -16,7 +16,7 @@ export const paramDef = {
|
||||
required: ["fileId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
createImportCustomEmojisJob(user, ps.fileId);
|
||||
});
|
||||
|
@ -77,7 +77,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const q = makePaginationQuery(
|
||||
Emojis.createQueryBuilder("emoji"),
|
||||
|
@ -71,7 +71,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const q = makePaginationQuery(
|
||||
Emojis.createQueryBuilder("emoji"),
|
||||
|
@ -31,7 +31,7 @@ export const paramDef = {
|
||||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emojis = await Emojis.findBy({
|
||||
id: In(ps.ids),
|
||||
|
@ -31,7 +31,7 @@ export const paramDef = {
|
||||
required: ["ids", "aliases"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Emojis.update(
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ export const paramDef = {
|
||||
required: ["ids"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await Emojis.update(
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ export const paramDef = {
|
||||
required: ["id", "name", "aliases"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const emoji = await Emojis.findOneBy({ id: ps.id });
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const files = await DriveFiles.findBy({
|
||||
userHost: ps.host,
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await Instances.findOneBy({ host: toPuny(ps.host) });
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["host"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const followings = await Followings.findBy({
|
||||
followerHost: ps.host,
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["host", "isSuspended"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await Instances.findOneBy({ host: toPuny(ps.host) });
|
||||
|
||||
|
@ -14,7 +14,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
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,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const sizes = await db
|
||||
.query(`
|
||||
|
@ -16,7 +16,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const ips = await UserIps.find({
|
||||
where: { userId: ps.userId },
|
||||
|
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const code = rndstr({
|
||||
length: 8,
|
||||
|
@ -465,7 +465,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const instance = await fetchMeta(true);
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -33,7 +33,7 @@ export const paramDef = {
|
||||
required: ["noteId", "expiresAt"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
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,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
destroy();
|
||||
|
||||
|
@ -37,7 +37,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const jobs = await deliverQueue.getJobs(["delayed"]);
|
||||
|
||||
|
@ -37,7 +37,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const jobs = await inboxQueue.getJobs(["delayed"]);
|
||||
|
||||
|
@ -47,7 +47,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const deliverJobCounts = await deliverQueue.getJobCounts();
|
||||
const inboxJobCounts = await inboxQueue.getJobCounts();
|
||||
|
@ -54,7 +54,7 @@ export const paramDef = {
|
||||
required: ["inbox"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
try {
|
||||
if (new URL(ps.inbox).protocol !== "https:") throw new Error("https only");
|
||||
|
@ -46,7 +46,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
return await listRelay();
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ export const paramDef = {
|
||||
required: ["inbox"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
return await removeRelay(ps.inbox);
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -21,7 +21,7 @@ export const paramDef = {
|
||||
required: ["reportId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const report = await AbuseUserReports.findOneByOrFail({ id: ps.reportId });
|
||||
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["to", "subject", "text"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
await sendEmail(ps.to, ps.subject, ps.text, ps.text);
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async () => {
|
||||
const memStats = await si.mem();
|
||||
const fsStats = await si.fsSize();
|
||||
|
@ -66,7 +66,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const query = makePaginationQuery(
|
||||
ModerationLogs.createQueryBuilder("report"),
|
||||
|
@ -22,7 +22,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const [user, profile] = await Promise.all([
|
||||
Users.findOneBy({ id: ps.userId }),
|
||||
|
@ -66,7 +66,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = Users.createQueryBuilder("user");
|
||||
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -21,7 +21,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -165,7 +165,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const set = {} as Partial<Meta>;
|
||||
|
||||
|
@ -17,7 +17,7 @@ export const paramDef = {
|
||||
required: ["userId", "text"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const user = await Users.findOneBy({ id: ps.userId });
|
||||
|
||||
|
@ -18,7 +18,7 @@ export const paramDef = {
|
||||
required: ["full", "analyze"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const params: string[] = [];
|
||||
|
||||
|
@ -72,7 +72,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const query = makePaginationQuery(
|
||||
Announcements.createQueryBuilder("announcement"),
|
||||
|
@ -82,7 +82,7 @@ export const paramDef = {
|
||||
],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
if (user.movedToUri != null) throw new ApiError(meta.errors.noSuchUserGroup);
|
||||
let userList;
|
||||
|
@ -27,7 +27,7 @@ export const paramDef = {
|
||||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
id: ps.antennaId,
|
||||
|
@ -27,7 +27,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const antennas = await Antennas.findBy({
|
||||
userId: me.id,
|
||||
|
@ -19,7 +19,7 @@ export const paramDef = {
|
||||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
userId: me.id,
|
||||
|
@ -48,7 +48,7 @@ export const paramDef = {
|
||||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const antenna = await Antennas.findOneBy({
|
||||
id: ps.antennaId,
|
||||
|
@ -33,7 +33,7 @@ export const paramDef = {
|
||||
required: ["antennaId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
// Fetch the antenna
|
||||
const antenna = await Antennas.findOneBy({
|
||||
|
@ -89,7 +89,7 @@ export const paramDef = {
|
||||
],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Fetch the antenna
|
||||
const antenna = await Antennas.findOneBy({
|
||||
|
@ -29,7 +29,7 @@ export const paramDef = {
|
||||
required: ["uri"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const resolver = new Resolver();
|
||||
const object = await resolver.resolve(ps.uri);
|
||||
|
@ -83,7 +83,7 @@ export const paramDef = {
|
||||
required: ["uri"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const object = await fetchAny(ps.uri, me);
|
||||
if (object) {
|
||||
|
@ -34,7 +34,7 @@ export const paramDef = {
|
||||
required: ["name", "description", "permission"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
if (user?.movedToUri != null)
|
||||
return await Apps.pack("", null, {
|
||||
|
@ -29,7 +29,7 @@ export const paramDef = {
|
||||
required: ["appId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user, token) => {
|
||||
const isSecure = user != null && token == null;
|
||||
|
||||
|
@ -29,7 +29,7 @@ export const paramDef = {
|
||||
required: ["token"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Fetch token
|
||||
const session = await AuthSessions.findOneBy({ token: ps.token });
|
||||
|
@ -46,7 +46,7 @@ export const paramDef = {
|
||||
required: ["appSecret"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
// Lookup app
|
||||
const app = await Apps.findOneBy({
|
||||
|
@ -49,7 +49,7 @@ export const paramDef = {
|
||||
required: ["token"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
// Lookup session
|
||||
const session = await AuthSessions.findOneBy({
|
||||
|
@ -57,7 +57,7 @@ export const paramDef = {
|
||||
required: ["appSecret", "token"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
// Lookup app
|
||||
const app = await Apps.findOneBy({
|
||||
|
@ -53,7 +53,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const blocker = await Users.findOneByOrFail({ id: user.id });
|
||||
|
||||
|
@ -53,7 +53,7 @@ export const paramDef = {
|
||||
required: ["userId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const blocker = await Users.findOneByOrFail({ id: user.id });
|
||||
|
||||
|
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
Blockings.createQueryBuilder("blocking"),
|
||||
|
@ -42,7 +42,7 @@ export const paramDef = {
|
||||
required: ["name"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
let banner = null;
|
||||
if (ps.bannerId != null) {
|
||||
|
@ -26,7 +26,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = Channels.createQueryBuilder("channel")
|
||||
.where("channel.lastNotedAt IS NOT NULL")
|
||||
|
@ -28,7 +28,7 @@ export const paramDef = {
|
||||
required: ["channelId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const channel = await Channels.findOneBy({
|
||||
id: ps.channelId,
|
||||
|
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
ChannelFollowings.createQueryBuilder(),
|
||||
|
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const query = makePaginationQuery(
|
||||
Channels.createQueryBuilder(),
|
||||
|
@ -32,7 +32,7 @@ export const paramDef = {
|
||||
required: ["channelId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
const channel = await Channels.findOneBy({
|
||||
id: ps.channelId,
|
||||
|
@ -44,7 +44,7 @@ export const paramDef = {
|
||||
required: ["channelId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const channel = await Channels.findOneBy({
|
||||
id: ps.channelId,
|
||||
|
@ -27,7 +27,7 @@ export const paramDef = {
|
||||
required: ["channelId"],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
|
||||
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
Block a user