mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🏷️ Move all types that represent ORM abstractions to ORM class static properties
This commit is contained in:
parent
ca31830fb3
commit
02c3c9d0bf
17 changed files with 143 additions and 136 deletions
|
|
@ -1,15 +1,9 @@
|
|||
import { parseUserAddress, userAddressValidator } from "@/api";
|
||||
import { Args, type Command, Flags, type Interfaces } from "@oclif/core";
|
||||
import { Instance, User, db } from "@versia/kit/db";
|
||||
import { type Emoji, Instance, User, db } from "@versia/kit/db";
|
||||
import { Emojis, Instances, Users } from "@versia/kit/tables";
|
||||
import chalk from "chalk";
|
||||
import {
|
||||
type InferSelectModel,
|
||||
and,
|
||||
eq,
|
||||
getTableColumns,
|
||||
like,
|
||||
} from "drizzle-orm";
|
||||
import { and, eq, getTableColumns, like } from "drizzle-orm";
|
||||
import { BaseCommand } from "./base.ts";
|
||||
|
||||
export type FlagsType<T extends typeof Command> = Interfaces.InferredFlags<
|
||||
|
|
@ -210,9 +204,12 @@ export abstract class EmojiFinderCommand<
|
|||
}
|
||||
|
||||
public async findEmojis(): Promise<
|
||||
(InferSelectModel<typeof Emojis> & {
|
||||
instanceUrl: string | null;
|
||||
})[]
|
||||
Omit<
|
||||
typeof Emoji.$type & {
|
||||
instanceUrl: string | null;
|
||||
},
|
||||
"instance"
|
||||
>[]
|
||||
> {
|
||||
// Check if there are asterisks in the identifier but no pattern flag, warn the user if so
|
||||
if (this.args.identifier.includes("*") && !this.flags.pattern) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue