mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: 🚨 Always explicitely state member accessibility
This commit is contained in:
parent
7a73b8db91
commit
54cea29ce9
36 changed files with 227 additions and 196 deletions
|
|
@ -9,7 +9,7 @@ import { BaseCommand } from "~/cli/base";
|
|||
import { config } from "~/packages/config-manager";
|
||||
|
||||
export default class EmojiAdd extends BaseCommand<typeof EmojiAdd> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
shortcode: Args.string({
|
||||
description: "Shortcode of the emoji",
|
||||
required: true,
|
||||
|
|
@ -20,14 +20,14 @@ export default class EmojiAdd extends BaseCommand<typeof EmojiAdd> {
|
|||
}),
|
||||
};
|
||||
|
||||
static override description = "Adds a new emoji";
|
||||
public static override description = "Adds a new emoji";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> baba_yassie ./emojis/baba_yassie.png",
|
||||
"<%= config.bin %> <%= command.id %> baba_yassie https://example.com/emojis/baba_yassie.png",
|
||||
];
|
||||
|
||||
static override flags = {};
|
||||
public static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { args } = await this.parse(EmojiAdd);
|
||||
|
|
|
|||
|
|
@ -13,18 +13,18 @@ import { config } from "~/packages/config-manager";
|
|||
export default class EmojiDelete extends EmojiFinderCommand<
|
||||
typeof EmojiDelete
|
||||
> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
identifier: EmojiFinderCommand.baseArgs.identifier,
|
||||
};
|
||||
|
||||
static override description = "Deletes an emoji";
|
||||
public static override description = "Deletes an emoji";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> baba_yassie",
|
||||
'<%= config.bin %> <%= command.id %> "baba\\*" --pattern',
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
confirm: Flags.boolean({
|
||||
description:
|
||||
"Ask for confirmation before deleting the emoji (default yes)",
|
||||
|
|
|
|||
|
|
@ -20,22 +20,22 @@ type MetaType = {
|
|||
};
|
||||
|
||||
export default class EmojiImport extends BaseCommand<typeof EmojiImport> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
path: Args.string({
|
||||
description: "Path to the emoji archive (can be an URL)",
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override description =
|
||||
public static override description =
|
||||
"Imports emojis from a zip file (which can be fetched from a zip URL, e.g. for Pleroma emoji packs)";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> https://volpeon.ink/emojis/neocat/neocat.zip",
|
||||
"<%= config.bin %> <%= command.id %> export.zip",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
confirm: Flags.boolean({
|
||||
description:
|
||||
"Ask for confirmation before deleting the emoji (default yes)",
|
||||
|
|
|
|||
|
|
@ -6,16 +6,16 @@ import { BaseCommand } from "~/cli/base";
|
|||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
export default class EmojiList extends BaseCommand<typeof EmojiList> {
|
||||
static override args = {};
|
||||
public static override args = {};
|
||||
|
||||
static override description = "List all emojis";
|
||||
public static override description = "List all emojis";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> --format json --local",
|
||||
"<%= config.bin %> <%= command.id %>",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
format: Flags.string({
|
||||
char: "f",
|
||||
description: "Output format",
|
||||
|
|
|
|||
|
|
@ -7,18 +7,18 @@ import { formatArray } from "~/cli/utils/format";
|
|||
export default class FederationInstanceFetch extends BaseCommand<
|
||||
typeof FederationInstanceFetch
|
||||
> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
url: Args.string({
|
||||
description: "URL of the remote instance",
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override description = "Fetch metadata from remote instances";
|
||||
public static override description = "Fetch metadata from remote instances";
|
||||
|
||||
static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
public static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
|
||||
static override flags = {};
|
||||
public static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { args } = await this.parse(FederationInstanceFetch);
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@ import { BaseCommand } from "~/cli/base";
|
|||
export default class FederationUserFetch extends BaseCommand<
|
||||
typeof FederationUserFetch
|
||||
> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
address: Args.string({
|
||||
description: "Address of remote user (name@host.com)",
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override description = "Fetch remote users";
|
||||
public static override description = "Fetch remote users";
|
||||
|
||||
static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
public static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
|
||||
static override flags = {};
|
||||
public static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { args } = await this.parse(FederationUserFetch);
|
||||
|
|
|
|||
|
|
@ -8,18 +8,19 @@ import { BaseCommand } from "~/cli/base";
|
|||
export default class FederationUserFinger extends BaseCommand<
|
||||
typeof FederationUserFinger
|
||||
> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
address: Args.string({
|
||||
description: "Address of remote user (name@host.com)",
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override description = "Fetch the URL of remote users via WebFinger";
|
||||
public static override description =
|
||||
"Fetch the URL of remote users via WebFinger";
|
||||
|
||||
static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
public static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
|
||||
static override flags = {};
|
||||
public static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { args } = await this.parse(FederationUserFinger);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@ import chalk from "chalk";
|
|||
import { BaseCommand } from "~/cli/base";
|
||||
|
||||
export default class GenerateKeys extends BaseCommand<typeof GenerateKeys> {
|
||||
static override args = {};
|
||||
public static override args = {};
|
||||
|
||||
static override description = "Generates keys to use in Versia Server";
|
||||
public static override description =
|
||||
"Generates keys to use in Versia Server";
|
||||
|
||||
static override flags = {};
|
||||
public static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { public_key, private_key } = await User.generateKeys();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { BaseCommand } from "~/cli/base";
|
|||
import { config } from "~/packages/config-manager";
|
||||
|
||||
export default class IndexRebuild extends BaseCommand<typeof IndexRebuild> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
type: Args.string({
|
||||
description: "Index category to rebuild",
|
||||
options: ["accounts", "statuses"],
|
||||
|
|
@ -13,11 +13,11 @@ export default class IndexRebuild extends BaseCommand<typeof IndexRebuild> {
|
|||
}),
|
||||
};
|
||||
|
||||
static override description = "Rebuild search indexes";
|
||||
public static override description = "Rebuild search indexes";
|
||||
|
||||
static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
public static override examples = ["<%= config.bin %> <%= command.id %>"];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
"batch-size": Flags.integer({
|
||||
char: "b",
|
||||
description: "Number of items to process in each batch",
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ import { Flags } from "@oclif/core";
|
|||
import { BaseCommand } from "~/cli/base";
|
||||
|
||||
export default class Start extends BaseCommand<typeof Start> {
|
||||
static override args = {};
|
||||
public static override args = {};
|
||||
|
||||
static override description = "Starts Versia Server";
|
||||
public static override description = "Starts Versia Server";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> --threads 4",
|
||||
"<%= config.bin %> <%= command.id %> --all-threads",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
threads: Flags.integer({
|
||||
char: "t",
|
||||
description: "Number of threads to use",
|
||||
|
|
|
|||
|
|
@ -9,21 +9,21 @@ import { BaseCommand } from "~/cli/base";
|
|||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
export default class UserCreate extends BaseCommand<typeof UserCreate> {
|
||||
static override args = {
|
||||
public static override args = {
|
||||
username: Args.string({
|
||||
description: "Username",
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override description = "Creates a new user";
|
||||
public static override description = "Creates a new user";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> johngastron --email joe@gamer.com",
|
||||
"<%= config.bin %> <%= command.id %> bimbobaggins",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
format: Flags.string({
|
||||
char: "f",
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@ import { UserFinderCommand } from "~/cli/classes";
|
|||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
export default class UserDelete extends UserFinderCommand<typeof UserDelete> {
|
||||
static override description = "Deletes users";
|
||||
public static override description = "Deletes users";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> johngastron --type username",
|
||||
"<%= config.bin %> <%= command.id %> 018ec11c-c6cb-7a67-bd20-a4c81bf42912",
|
||||
'<%= config.bin %> <%= command.id %> "*badword*" --pattern --type username',
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
confirm: Flags.boolean({
|
||||
description:
|
||||
"Ask for confirmation before deleting the user (default yes)",
|
||||
|
|
@ -23,7 +23,7 @@ export default class UserDelete extends UserFinderCommand<typeof UserDelete> {
|
|||
}),
|
||||
};
|
||||
|
||||
static override args = {
|
||||
public static override args = {
|
||||
identifier: UserFinderCommand.baseArgs.identifier,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,16 +6,16 @@ import { BaseCommand } from "~/cli/base";
|
|||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
export default class UserList extends BaseCommand<typeof UserList> {
|
||||
static override args = {};
|
||||
public static override args = {};
|
||||
|
||||
static override description = "List all users";
|
||||
public static override description = "List all users";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> --format json --local",
|
||||
"<%= config.bin %> <%= command.id %>",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
format: Flags.string({
|
||||
char: "f",
|
||||
description: "Output format",
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ import { UserFinderCommand } from "~/cli/classes";
|
|||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
||||
static override description = "Refetch remote users";
|
||||
public static override description = "Refetch remote users";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> johngastron --type username",
|
||||
"<%= config.bin %> <%= command.id %> 018ec11c-c6cb-7a67-bd20-a4c81bf42912",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
confirm: Flags.boolean({
|
||||
description:
|
||||
"Ask for confirmation before refetching the user (default yes)",
|
||||
|
|
@ -27,7 +27,7 @@ export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
|||
}),
|
||||
};
|
||||
|
||||
static override args = {
|
||||
public static override args = {
|
||||
identifier: UserFinderCommand.baseArgs.identifier,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ import { formatArray } from "~/cli/utils/format";
|
|||
import { config } from "~/packages/config-manager";
|
||||
|
||||
export default class UserReset extends UserFinderCommand<typeof UserReset> {
|
||||
static override description = "Resets users' passwords";
|
||||
public static override description = "Resets users' passwords";
|
||||
|
||||
static override examples = [
|
||||
public static override examples = [
|
||||
"<%= config.bin %> <%= command.id %> johngastron --type username",
|
||||
"<%= config.bin %> <%= command.id %> 018ec11c-c6cb-7a67-bd20-a4c81bf42912",
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
public static override flags = {
|
||||
confirm: Flags.boolean({
|
||||
description:
|
||||
"Ask for confirmation before deleting the user (default yes)",
|
||||
|
|
@ -32,7 +32,7 @@ export default class UserReset extends UserFinderCommand<typeof UserReset> {
|
|||
}),
|
||||
};
|
||||
|
||||
static override args = {
|
||||
public static override args = {
|
||||
identifier: UserFinderCommand.baseArgs.identifier,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue