refactor: 🚚 Add slash to typescript path shortcuts

This commit is contained in:
Jesse Wierzbinski 2024-05-28 14:59:49 -10:00
parent 5b658984a5
commit 0706541546
No known key found for this signature in database
176 changed files with 733 additions and 733 deletions

View file

@ -1,7 +1,7 @@
import { $ } from "bun";
import chalk from "chalk";
import ora from "ora";
import { routes } from "~routes";
import { routes } from "~/routes";
const buildSpinner = ora("Building").start();

View file

@ -1,6 +1,6 @@
import { consoleLogger } from "@loggers";
import { consoleLogger } from "@/loggers";
import { Command } from "@oclif/core";
import { setupDatabase } from "~drizzle/db";
import { setupDatabase } from "~/drizzle/db";
export abstract class BaseCommand<T extends typeof Command> extends Command {
protected async init(): Promise<void> {

View file

@ -1,9 +1,9 @@
import { Args, type Command, Flags, type Interfaces } from "@oclif/core";
import chalk from "chalk";
import { and, eq, getTableColumns, like } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Emojis, Instances, Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { db } from "~/drizzle/db";
import { Emojis, Instances, Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
import { BaseCommand } from "./base";
export type FlagsType<T extends typeof Command> = Interfaces.InferredFlags<

View file

@ -1,12 +1,12 @@
import { Args } from "@oclif/core";
import chalk from "chalk";
import ora from "ora";
import { BaseCommand } from "~/cli/base";
import { getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { MediaBackend } from "~packages/media-manager";
import { BaseCommand } from "~//cli/base";
import { getUrl } from "~/database/entities/Attachment";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { MediaBackend } from "~/packages/media-manager";
export default class EmojiAdd extends BaseCommand<typeof EmojiAdd> {
static override args = {

View file

@ -3,12 +3,12 @@ import { Args, Flags } from "@oclif/core";
import chalk from "chalk";
import { and, eq, inArray, isNull } from "drizzle-orm";
import ora from "ora";
import { EmojiFinderCommand } from "~cli/classes";
import { formatArray } from "~cli/utils/format";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { MediaBackend } from "~packages/media-manager";
import { EmojiFinderCommand } from "~/cli/classes";
import { formatArray } from "~/cli/utils/format";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { MediaBackend } from "~/packages/media-manager";
export default class EmojiDelete extends EmojiFinderCommand<
typeof EmojiDelete

View file

@ -4,12 +4,12 @@ import { and, inArray, isNull } from "drizzle-orm";
import { lookup } from "mime-types";
import ora from "ora";
import { unzip } from "unzipit";
import { BaseCommand } from "~/cli/base";
import { getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { MediaBackend } from "~packages/media-manager";
import { BaseCommand } from "~//cli/base";
import { getUrl } from "~/database/entities/Attachment";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { MediaBackend } from "~/packages/media-manager";
type MetaType = {
emojis: {

View file

@ -1,9 +1,9 @@
import { Flags } from "@oclif/core";
import { and, eq, getTableColumns, isNotNull, isNull } from "drizzle-orm";
import { BaseCommand } from "~cli/base";
import { formatArray } from "~cli/utils/format";
import { db } from "~drizzle/db";
import { Emojis, Instances, Users } from "~drizzle/schema";
import { BaseCommand } from "~/cli/base";
import { formatArray } from "~/cli/utils/format";
import { db } from "~/drizzle/db";
import { Emojis, Instances, Users } from "~/drizzle/schema";
export default class EmojiList extends BaseCommand<typeof EmojiList> {
static override args = {};

View file

@ -1,6 +1,6 @@
import os from "node:os";
import { Flags } from "@oclif/core";
import { BaseCommand } from "~cli/base";
import { BaseCommand } from "~/cli/base";
export default class Start extends BaseCommand<typeof Start> {
static override args = {};

View file

@ -3,10 +3,10 @@ import { Args, Flags } from "@oclif/core";
import chalk from "chalk";
import { eq } from "drizzle-orm";
import { renderUnicodeCompact } from "uqr";
import { BaseCommand } from "~cli/base";
import { formatArray } from "~cli/utils/format";
import { Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { BaseCommand } from "~/cli/base";
import { formatArray } from "~/cli/utils/format";
import { Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export default class UserCreate extends BaseCommand<typeof UserCreate> {
static override args = {

View file

@ -2,8 +2,8 @@ import confirm from "@inquirer/confirm";
import { Flags } from "@oclif/core";
import chalk from "chalk";
import ora from "ora";
import { UserFinderCommand } from "~cli/classes";
import { formatArray } from "~cli/utils/format";
import { UserFinderCommand } from "~/cli/classes";
import { formatArray } from "~/cli/utils/format";
export default class UserDelete extends UserFinderCommand<typeof UserDelete> {
static override description = "Deletes users";

View file

@ -1,9 +1,9 @@
import { Flags } from "@oclif/core";
import { and, eq, isNotNull, isNull } from "drizzle-orm";
import { BaseCommand } from "~cli/base";
import { formatArray } from "~cli/utils/format";
import { Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { BaseCommand } from "~/cli/base";
import { formatArray } from "~/cli/utils/format";
import { Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export default class UserList extends BaseCommand<typeof UserList> {
static override args = {};

View file

@ -2,9 +2,9 @@ import confirm from "@inquirer/confirm";
import { Flags } from "@oclif/core";
import chalk from "chalk";
import { renderUnicodeCompact } from "uqr";
import { UserFinderCommand } from "~cli/classes";
import { formatArray } from "~cli/utils/format";
import { config } from "~packages/config-manager";
import { UserFinderCommand } from "~/cli/classes";
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";

View file

@ -1,7 +1,7 @@
import type { InferSelectModel } from "drizzle-orm";
import { db } from "~drizzle/db";
import type { Applications } from "~drizzle/schema";
import type { Application as APIApplication } from "~types/mastodon/application";
import { db } from "~/drizzle/db";
import type { Applications } from "~/drizzle/schema";
import type { Application as APIApplication } from "~/types/mastodon/application";
export type Application = InferSelectModel<typeof Applications>;

View file

@ -1,12 +1,12 @@
import { proxyUrl } from "@/response";
import type { EntityValidator } from "@lysand-org/federation";
import { proxyUrl } from "@response";
import type { Config } from "config-manager";
import type { InferSelectModel } from "drizzle-orm";
import { MediaBackendType } from "media-manager";
import { db } from "~drizzle/db";
import { Attachments } from "~drizzle/schema";
import type { AsyncAttachment as APIAsyncAttachment } from "~types/mastodon/async_attachment";
import type { Attachment as APIAttachment } from "~types/mastodon/attachment";
import { db } from "~/drizzle/db";
import { Attachments } from "~/drizzle/schema";
import type { AsyncAttachment as APIAsyncAttachment } from "~/types/mastodon/async_attachment";
import type { Attachment as APIAttachment } from "~/types/mastodon/attachment";
export type Attachment = InferSelectModel<typeof Attachments>;

View file

@ -1,10 +1,10 @@
import { emojiValidatorWithColons } from "@api";
import { emojiValidatorWithColons } from "@/api";
import { proxyUrl } from "@/response";
import type { EntityValidator } from "@lysand-org/federation";
import { proxyUrl } from "@response";
import { type InferSelectModel, and, eq } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Emojis, Instances } from "~drizzle/schema";
import type { Emoji as APIEmoji } from "~types/mastodon/emoji";
import { db } from "~/drizzle/db";
import { Emojis, Instances } from "~/drizzle/schema";
import type { Emoji as APIEmoji } from "~/types/mastodon/emoji";
import { addInstanceIfNotExists } from "./Instance";
export type EmojiWithInstance = InferSelectModel<typeof Emojis> & {

View file

@ -1,11 +1,11 @@
import { debugRequest } from "@api";
import { debugRequest } from "@/api";
import {
type EntityValidator,
SignatureConstructor,
} from "@lysand-org/federation";
import { config } from "config-manager";
import type { User } from "~packages/database-interface/user";
import { LogLevel, LogManager } from "~packages/log-manager";
import type { User } from "~/packages/database-interface/user";
import { LogLevel, LogManager } from "~/packages/log-manager";
export const localObjectURI = (id: string) =>
new URL(`/objects/${id}`, config.http.base_url).toString();

View file

@ -1,6 +1,6 @@
import type { EntityValidator } from "@lysand-org/federation";
import { db } from "~drizzle/db";
import { Instances } from "~drizzle/schema";
import { db } from "~/drizzle/db";
import { Instances } from "~/drizzle/schema";
/**
* Represents an instance in the database.

View file

@ -1,10 +1,10 @@
import type { EntityValidator } from "@lysand-org/federation";
import { config } from "config-manager";
import { type InferSelectModel, and, eq } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Likes, Notifications } from "~drizzle/schema";
import type { Note } from "~packages/database-interface/note";
import type { User } from "~packages/database-interface/user";
import { db } from "~/drizzle/db";
import { Likes, Notifications } from "~/drizzle/schema";
import type { Note } from "~/packages/database-interface/note";
import type { User } from "~/packages/database-interface/user";
export type Like = InferSelectModel<typeof Likes>;

View file

@ -1,9 +1,9 @@
import type { InferSelectModel } from "drizzle-orm";
import { db } from "~drizzle/db";
import type { Notifications } from "~drizzle/schema";
import { Note } from "~packages/database-interface/note";
import { User } from "~packages/database-interface/user";
import type { Notification as APINotification } from "~types/mastodon/notification";
import { db } from "~/drizzle/db";
import type { Notifications } from "~/drizzle/schema";
import { Note } from "~/packages/database-interface/note";
import { User } from "~/packages/database-interface/user";
import type { Notification as APINotification } from "~/types/mastodon/notification";
import type { StatusWithRelations } from "./Status";
import {
type UserWithRelations,

View file

@ -1,8 +1,8 @@
import type { InferSelectModel } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import type { User } from "~packages/database-interface/user";
import type { Relationship as APIRelationship } from "~types/mastodon/relationship";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import type { User } from "~/packages/database-interface/user";
import type { Relationship as APIRelationship } from "~/types/mastodon/relationship";
import type { UserType } from "./User";
export type Relationship = InferSelectModel<typeof Relationships>;

View file

@ -1,8 +1,8 @@
import { mentionValidator } from "@api";
import { mentionValidator } from "@/api";
import { dualLogger } from "@/loggers";
import { sanitizeHtml, sanitizeHtmlInline } from "@/sanitization";
import markdownItTaskLists from "@hackmd/markdown-it-task-lists";
import { dualLogger } from "@loggers";
import type { EntityValidator } from "@lysand-org/federation";
import { sanitizeHtml, sanitizeHtmlInline } from "@sanitization";
import { config } from "config-manager";
import {
type InferSelectModel,
@ -29,12 +29,12 @@ import MarkdownIt from "markdown-it";
import markdownItAnchor from "markdown-it-anchor";
import markdownItContainer from "markdown-it-container";
import markdownItTocDoneRight from "markdown-it-toc-done-right";
import { db } from "~drizzle/db";
import { type Attachments, Instances, Notes, Users } from "~drizzle/schema";
import { Note } from "~packages/database-interface/note";
import { User } from "~packages/database-interface/user";
import { LogLevel } from "~packages/log-manager";
import type { Status as APIStatus } from "~types/mastodon/status";
import { db } from "~/drizzle/db";
import { type Attachments, Instances, Notes, Users } from "~/drizzle/schema";
import { Note } from "~/packages/database-interface/note";
import { User } from "~/packages/database-interface/user";
import { LogLevel } from "~/packages/log-manager";
import type { Status as APIStatus } from "~/types/mastodon/status";
import type { Application } from "./Application";
import { attachmentFromLysand } from "./Attachment";
import { type EmojiWithInstance, fetchEmoji } from "./Emoji";

View file

@ -1,5 +1,5 @@
import type { InferSelectModel } from "drizzle-orm";
import type { Tokens } from "~drizzle/schema";
import type { Tokens } from "~/drizzle/schema";
/**
* The type of token.

View file

@ -1,8 +1,8 @@
import { dualLogger } from "@loggers";
import { dualLogger } from "@/loggers";
import type { EntityValidator } from "@lysand-org/federation";
import { config } from "config-manager";
import { type InferSelectModel, and, eq, sql } from "drizzle-orm";
import { db } from "~drizzle/db";
import { db } from "~/drizzle/db";
import {
Applications,
Instances,
@ -10,9 +10,9 @@ import {
Relationships,
Tokens,
Users,
} from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { LogLevel } from "~packages/log-manager";
} from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
import { LogLevel } from "~/packages/log-manager";
import type { Application } from "./Application";
import type { EmojiWithInstance } from "./Emoji";
import { objectToInboxRequest } from "./Federation";

View file

@ -2,7 +2,7 @@ import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/postgres-js/migrator";
import { LogLevel, LogManager, type MultiLogManager } from "log-manager";
import { Client } from "pg";
import { config } from "~/packages/config-manager";
import { config } from "~//packages/config-manager";
import * as schema from "./schema";
export const client = new Client({

View file

@ -13,7 +13,7 @@ import {
uniqueIndex,
uuid,
} from "drizzle-orm/pg-core";
import type { Source as APISource } from "~types/mastodon/source";
import type { Source as APISource } from "~/types/mastodon/source";
export const Emojis = pgTable("Emojis", {
id: uuid("id").default(sql`uuid_generate_v7()`).primaryKey().notNull(),

View file

@ -1,22 +1,22 @@
import { dualLogger } from "@loggers";
import { connectMeili } from "@meilisearch";
import { errorResponse, response } from "@response";
import { dualLogger } from "@/loggers";
import { connectMeili } from "@/meilisearch";
import { errorResponse, response } from "@/response";
import chalk from "chalk";
import { config } from "config-manager";
import { Hono } from "hono";
import { LogLevel, LogManager, type MultiLogManager } from "log-manager";
import { setupDatabase } from "~drizzle/db";
import { agentBans } from "~middlewares/agent-bans";
import { bait } from "~middlewares/bait";
import { boundaryCheck } from "~middlewares/boundary-check";
import { ipBans } from "~middlewares/ip-bans";
import { logger } from "~middlewares/logger";
import { urlCheck } from "~middlewares/url-check";
import { Note } from "~packages/database-interface/note";
import { handleGlitchRequest } from "~packages/glitch-server/main";
import { routes } from "~routes";
import { createServer } from "~server";
import type { APIRouteExports } from "~types/api";
import { setupDatabase } from "~/drizzle/db";
import { agentBans } from "~/middlewares/agent-bans";
import { bait } from "~/middlewares/bait";
import { boundaryCheck } from "~/middlewares/boundary-check";
import { ipBans } from "~/middlewares/ip-bans";
import { logger } from "~/middlewares/logger";
import { urlCheck } from "~/middlewares/url-check";
import { Note } from "~/packages/database-interface/note";
import { handleGlitchRequest } from "~/packages/glitch-server/main";
import { routes } from "~/routes";
import { createServer } from "~/server";
import type { APIRouteExports } from "~/types/api";
const timeAtStart = performance.now();

View file

@ -1,6 +1,6 @@
import { errorResponse } from "@response";
import { errorResponse } from "@/response";
import { createMiddleware } from "hono/factory";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const agentBans = createMiddleware(async (context, next) => {
// Check for banned user agents (regex)

View file

@ -1,10 +1,10 @@
import { logger } from "@loggers";
import { errorResponse, response } from "@response";
import { logger } from "@/loggers";
import { errorResponse, response } from "@/response";
import type { SocketAddress } from "bun";
import { createMiddleware } from "hono/factory";
import { matches } from "ip-matching";
import { config } from "~packages/config-manager";
import { LogLevel } from "~packages/log-manager";
import { config } from "~/packages/config-manager";
import { LogLevel } from "~/packages/log-manager";
export const bait = createMiddleware(async (context, next) => {
const request_ip = context.env?.ip as SocketAddress | undefined | null;

View file

@ -1,4 +1,4 @@
import { errorResponse } from "@response";
import { errorResponse } from "@/response";
import { createMiddleware } from "hono/factory";
export const boundaryCheck = createMiddleware(async (context, next) => {

View file

@ -1,10 +1,10 @@
import { logger } from "@loggers";
import { errorResponse } from "@response";
import { logger } from "@/loggers";
import { errorResponse } from "@/response";
import type { SocketAddress } from "bun";
import { createMiddleware } from "hono/factory";
import { matches } from "ip-matching";
import { config } from "~packages/config-manager";
import { LogLevel } from "~packages/log-manager";
import { config } from "~/packages/config-manager";
import { LogLevel } from "~/packages/log-manager";
export const ipBans = createMiddleware(async (context, next) => {
// Check for banned IPs

View file

@ -1,7 +1,7 @@
import { dualLogger } from "@loggers";
import { dualLogger } from "@/loggers";
import type { SocketAddress } from "bun";
import { createMiddleware } from "hono/factory";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const logger = createMiddleware(async (context, next) => {
const request_ip = context.env?.ip as SocketAddress | undefined | null;

View file

@ -1,6 +1,6 @@
import { errorResponse } from "@response";
import { errorResponse } from "@/response";
import { createMiddleware } from "hono/factory";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const urlCheck = createMiddleware(async (context, next) => {
// Check that request URL matches base_url

View file

@ -1,6 +1,6 @@
import { proxyUrl } from "@/response";
import { sanitizedHtmlStrip } from "@/sanitization";
import type { EntityValidator } from "@lysand-org/federation";
import { proxyUrl } from "@response";
import { sanitizedHtmlStrip } from "@sanitization";
import {
type InferInsertModel,
type SQL,
@ -17,25 +17,25 @@ import { createRegExp, exactly, global } from "magic-regexp";
import {
type Application,
applicationToAPI,
} from "~database/entities/Application";
} from "~/database/entities/Application";
import {
attachmentToAPI,
attachmentToLysand,
} from "~database/entities/Attachment";
} from "~/database/entities/Attachment";
import {
type EmojiWithInstance,
emojiToAPI,
emojiToLysand,
parseEmojis,
} from "~database/entities/Emoji";
import { localObjectURI } from "~database/entities/Federation";
} from "~/database/entities/Emoji";
import { localObjectURI } from "~/database/entities/Federation";
import {
type Status,
type StatusWithRelations,
contentToHtml,
findManyNotes,
} from "~database/entities/Status";
import { db } from "~drizzle/db";
} from "~/database/entities/Status";
import { db } from "~/drizzle/db";
import {
Attachments,
EmojiToNote,
@ -43,10 +43,10 @@ import {
Notes,
Notifications,
Users,
} from "~drizzle/schema";
import { config } from "~packages/config-manager";
import type { Attachment as APIAttachment } from "~types/mastodon/attachment";
import type { Status as APIStatus } from "~types/mastodon/status";
} from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import type { Attachment as APIAttachment } from "~/types/mastodon/attachment";
import type { Status as APIStatus } from "~/types/mastodon/status";
import { User } from "./user";
/**

View file

@ -1,5 +1,5 @@
import { oauthRedirectUri } from "@constants";
import { errorResponse, response } from "@response";
import { oauthRedirectUri } from "@/constants";
import { errorResponse, response } from "@/response";
import type { InferInsertModel } from "drizzle-orm";
import {
type AuthorizationServer,
@ -14,10 +14,10 @@ import {
userInfoRequest,
validateAuthResponse,
} from "oauth4webapi";
import type { Application } from "~database/entities/Application";
import { db } from "~drizzle/db";
import { type Applications, OpenIdAccounts } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import type { Application } from "~/database/entities/Application";
import { db } from "~/drizzle/db";
import { type Applications, OpenIdAccounts } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
export class OAuthManager {
public issuer: (typeof config.oidc.providers)[0];

View file

@ -1,6 +1,6 @@
import { type SQL, gt } from "drizzle-orm";
import { Notes, Users } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { Notes, Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { Note } from "./note";
import { User } from "./user";

View file

@ -1,9 +1,9 @@
import { randomBytes } from "node:crypto";
import { idValidator } from "@api";
import { getBestContentType, urlToContentFormat } from "@content_types";
import { idValidator } from "@/api";
import { getBestContentType, urlToContentFormat } from "@/content_types";
import { addUserToMeilisearch } from "@/meilisearch";
import { proxyUrl } from "@/response";
import type { EntityValidator } from "@lysand-org/federation";
import { addUserToMeilisearch } from "@meilisearch";
import { proxyUrl } from "@response";
import {
type SQL,
and,
@ -20,24 +20,24 @@ import {
emojiToAPI,
emojiToLysand,
fetchEmoji,
} from "~database/entities/Emoji";
import { addInstanceIfNotExists } from "~database/entities/Instance";
} from "~/database/entities/Emoji";
import { addInstanceIfNotExists } from "~/database/entities/Instance";
import {
type UserWithRelations,
findFirstUser,
findManyUsers,
} from "~database/entities/User";
import { db } from "~drizzle/db";
} from "~/database/entities/User";
import { db } from "~/drizzle/db";
import {
EmojiToUser,
NoteToMentions,
Notes,
UserToPinnedNotes,
Users,
} from "~drizzle/schema";
import { type Config, config } from "~packages/config-manager";
import type { Account as APIAccount } from "~types/mastodon/account";
import type { Mention as APIMention } from "~types/mastodon/mention";
} from "~/drizzle/schema";
import { type Config, config } from "~/packages/config-manager";
import type { Account as APIAccount } from "~/types/mastodon/account";
import type { Mention as APIMention } from "~/types/mastodon/mention";
import type { Note } from "./note";
/**

View file

@ -1,10 +1,10 @@
import { join } from "node:path";
import { redirect } from "@response";
import { redirect } from "@/response";
import type { BunFile } from "bun";
import { config } from "config-manager";
import { retrieveUserFromToken } from "~database/entities/User";
import type { User } from "~packages/database-interface/user";
import type { LogManager, MultiLogManager } from "~packages/log-manager";
import { retrieveUserFromToken } from "~/database/entities/User";
import type { User } from "~/packages/database-interface/user";
import type { LogManager, MultiLogManager } from "~/packages/log-manager";
import { languages } from "./glitch-languages";
const handleManifestRequest = async () => {

View file

@ -1,7 +1,7 @@
import { applyConfig } from "@api";
import { jsonResponse } from "@response";
import { applyConfig } from "@/api";
import { jsonResponse } from "@/response";
import type { Hono } from "hono";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,10 +1,10 @@
import { afterAll, describe, expect, test } from "bun:test";
import { randomBytes } from "node:crypto";
import { eq } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Applications } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import { db } from "~/drizzle/db";
import { Applications } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, deleteUsers, passwords } = await getTestUsers(1);

View file

@ -1,14 +1,14 @@
import { applyConfig, handleZodError } from "@api";
import { applyConfig, handleZodError } from "@/api";
import { errorResponse, redirect, response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, redirect, response } from "@response";
import { eq, or } from "drizzle-orm";
import type { Hono } from "hono";
import { SignJWT } from "jose";
import { z } from "zod";
import { db } from "~drizzle/db";
import { Users } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { User } from "~packages/database-interface/user";
import { db } from "~/drizzle/db";
import { Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,15 +1,15 @@
import { randomBytes } from "node:crypto";
import { applyConfig, handleZodError } from "@api";
import { applyConfig, handleZodError } from "@/api";
import { response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { response } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { TokenType } from "~database/entities/Token";
import { db } from "~drizzle/db";
import { Tokens, Users } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { User } from "~packages/database-interface/user";
import { TokenType } from "~/database/entities/Token";
import { db } from "~/drizzle/db";
import { Tokens, Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,6 +1,6 @@
import { applyConfig } from "@api";
import { applyConfig } from "@/api";
import type { Hono } from "hono";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,11 +1,11 @@
import { applyConfig, handleZodError } from "@api";
import { applyConfig, handleZodError } from "@/api";
import { zValidator } from "@hono/zod-validator";
import { and, eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { db } from "~drizzle/db";
import { Applications, Tokens } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { db } from "~/drizzle/db";
import { Applications, Tokens } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,10 +1,10 @@
import { afterAll, describe, expect, test } from "bun:test";
import { randomBytes } from "node:crypto";
import { eq } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Applications } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import { db } from "~/drizzle/db";
import { Applications } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, deleteUsers, passwords } = await getTestUsers(1);

View file

@ -1,12 +1,12 @@
import { applyConfig, handleZodError } from "@api";
import { applyConfig, handleZodError } from "@/api";
import { response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { response } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { User } from "~packages/database-interface/user";
import { Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Relationship as APIRelationship } from "~types/mastodon/relationship";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Relationship as APIRelationship } from "~/types/mastodon/relationship";
import { meta } from "./block";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Relationship as APIRelationship } from "~types/mastodon/relationship";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Relationship as APIRelationship } from "~/types/mastodon/relationship";
import { meta } from "./follow";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,15 +1,15 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import type { Hono } from "hono";
import ISO6391 from "iso-639-1";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { relationshipToAPI } from "~/database/entities/Relationship";
import {
followRequestUser,
getRelationshipToOtherUser,
} from "~database/entities/User";
import { User } from "~packages/database-interface/user";
} from "~/database/entities/User";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./followers";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,12 +1,12 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, gt, gte, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { User } from "~packages/database-interface/user";
import { Users } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./following";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,12 +1,12 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, gt, gte, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { User } from "~packages/database-interface/user";
import { Users } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,9 +1,9 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import type { Hono } from "hono";
import { z } from "zod";
import { User } from "~packages/database-interface/user";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Relationship as APIRelationship } from "~types/mastodon/relationship";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Relationship as APIRelationship } from "~/types/mastodon/relationship";
import { meta } from "./mute";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~tests/utils";
import type { Status as APIStatus } from "~types/mastodon/status";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Status as APIStatus } from "~/types/mastodon/status";
import { meta } from "./statuses";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,12 +1,12 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, eq, gt, gte, isNull, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Notes } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { User } from "~packages/database-interface/user";
import { Notes } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Relationship as APIRelationship } from "~types/mastodon/relationship";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Relationship as APIRelationship } from "~/types/mastodon/relationship";
import { meta } from "./unmute";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { relationshipToAPI } from "~database/entities/Relationship";
import { getRelationshipToOtherUser } from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { relationshipToAPI } from "~/database/entities/Relationship";
import { getRelationshipToOtherUser } from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,12 +1,12 @@
import { applyConfig, auth, handleZodError, idValidator, qsQuery } from "@api";
import { applyConfig, auth, handleZodError, idValidator, qsQuery } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { inArray } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { db } from "~drizzle/db";
import { Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { db } from "~/drizzle/db";
import { Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -9,10 +9,10 @@ import {
import { randomBytes } from "node:crypto";
import { config } from "config-manager";
import { eq } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Users } from "~drizzle/schema";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { db } from "~/drizzle/db";
import { Users } from "~/drizzle/schema";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./index";
const username = randomBytes(10).toString("hex");

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError, jsonOrForm } from "@api";
import { applyConfig, auth, handleZodError, jsonOrForm } from "@/api";
import { jsonResponse, response } from "@/response";
import { tempmailDomains } from "@/tempmail";
import { zValidator } from "@hono/zod-validator";
import { jsonResponse, response } from "@response";
import { tempmailDomains } from "@tempmail";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import ISO6391 from "iso-639-1";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { User } from "~packages/database-interface/user";
import { Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,7 +1,7 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { dualLogger } from "@/loggers";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { dualLogger } from "@loggers";
import { errorResponse, jsonResponse } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import {
@ -16,10 +16,10 @@ import {
oneOrMore,
} from "magic-regexp";
import { z } from "zod";
import { resolveWebFinger } from "~database/entities/User";
import { Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { LogLevel } from "~packages/log-manager";
import { resolveWebFinger } from "~/database/entities/User";
import { Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
import { LogLevel } from "~/packages/log-manager";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth, handleZodError, idValidator, qsQuery } from "@api";
import { applyConfig, auth, handleZodError, idValidator, qsQuery } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import type { Hono } from "hono";
import { z } from "zod";
import {
createNewRelationship,
relationshipToAPI,
} from "~database/entities/Relationship";
import { db } from "~drizzle/db";
import { User } from "~packages/database-interface/user";
} from "~/database/entities/Relationship";
import { db } from "~/drizzle/db";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import type { Account as APIAccount } from "~types/mastodon/account";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import type { Account as APIAccount } from "~/types/mastodon/account";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,6 +1,6 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { eq, like, not, or, sql } from "drizzle-orm";
import type { Hono } from "hono";
import {
@ -16,9 +16,9 @@ import {
} from "magic-regexp";
import stringComparison from "string-comparison";
import { z } from "zod";
import { resolveWebFinger } from "~database/entities/User";
import { Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { resolveWebFinger } from "~/database/entities/User";
import { Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { applyConfig, auth, handleZodError, qs } from "@api";
import { applyConfig, auth, handleZodError, qs } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { sanitizedHtmlStrip } from "@/sanitization";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { sanitizedHtmlStrip } from "@sanitization";
import { config } from "config-manager";
import { and, eq } from "drizzle-orm";
import type { Hono } from "hono";
@ -10,12 +10,12 @@ import { MediaBackendType } from "media-manager";
import type { MediaBackend } from "media-manager";
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
import { z } from "zod";
import { getUrl } from "~database/entities/Attachment";
import { type EmojiWithInstance, parseEmojis } from "~database/entities/Emoji";
import { contentToHtml } from "~database/entities/Status";
import { db } from "~drizzle/db";
import { EmojiToUser, Users } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
import { getUrl } from "~/database/entities/Attachment";
import { type EmojiWithInstance, parseEmojis } from "~/database/entities/Emoji";
import { contentToHtml } from "~/database/entities/Status";
import { db } from "~/drizzle/db";
import { EmojiToUser, Users } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["PATCH"],

View file

@ -1,5 +1,5 @@
import { applyConfig, auth } from "@api";
import { errorResponse, jsonResponse } from "@response";
import { applyConfig, auth } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import type { Hono } from "hono";
export const meta = applyConfig({

View file

@ -1,11 +1,11 @@
import { randomBytes } from "node:crypto";
import { applyConfig, handleZodError, jsonOrForm } from "@api";
import { applyConfig, handleZodError, jsonOrForm } from "@/api";
import { jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { jsonResponse } from "@response";
import type { Hono } from "hono";
import { z } from "zod";
import { db } from "~drizzle/db";
import { Applications } from "~drizzle/schema";
import { db } from "~/drizzle/db";
import { Applications } from "~/drizzle/schema";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,7 +1,7 @@
import { applyConfig, auth } from "@api";
import { errorResponse, jsonResponse } from "@response";
import { applyConfig, auth } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import type { Hono } from "hono";
import { getFromToken } from "~database/entities/Application";
import { getFromToken } from "~/database/entities/Application";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,11 +1,11 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, gt, gte, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { Users } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,9 +1,9 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { inArray } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,8 +1,8 @@
import { applyConfig, auth } from "@api";
import { jsonResponse } from "@response";
import { applyConfig, auth } from "@/api";
import { jsonResponse } from "@/response";
import type { Hono } from "hono";
import { emojiToAPI } from "~database/entities/Emoji";
import { db } from "~drizzle/db";
import { emojiToAPI } from "~/database/entities/Emoji";
import { db } from "~/drizzle/db";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,9 +1,9 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { inArray } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -4,19 +4,19 @@ import {
emojiValidator,
handleZodError,
jsonOrForm,
} from "@api";
import { mimeLookup } from "@content_types";
} from "@/api";
import { mimeLookup } from "@/content_types";
import { errorResponse, jsonResponse, response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse, response } from "@response";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { getUrl } from "~database/entities/Attachment";
import { emojiToAPI } from "~database/entities/Emoji";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { MediaBackend } from "~packages/media-manager";
import { getUrl } from "~/database/entities/Attachment";
import { emojiToAPI } from "~/database/entities/Emoji";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { MediaBackend } from "~/packages/media-manager";
export const meta = applyConfig({
allowedMethods: ["DELETE", "GET", "PATCH"],

View file

@ -1,9 +1,9 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { inArray } from "drizzle-orm";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { getTestUsers, sendTestRequest } from "~tests/utils";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(3);

View file

@ -4,18 +4,18 @@ import {
emojiValidator,
handleZodError,
jsonOrForm,
} from "@api";
import { mimeLookup } from "@content_types";
} from "@/api";
import { mimeLookup } from "@/content_types";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import type { Hono } from "hono";
import { z } from "zod";
import { getUrl } from "~database/entities/Attachment";
import { emojiToAPI } from "~database/entities/Emoji";
import { db } from "~drizzle/db";
import { Emojis } from "~drizzle/schema";
import { config } from "~packages/config-manager";
import { MediaBackend } from "~packages/media-manager";
import { getUrl } from "~/database/entities/Attachment";
import { emojiToAPI } from "~/database/entities/Emoji";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
import { MediaBackend } from "~/packages/media-manager";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,11 +1,11 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, gt, gte, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Notes } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { Notes } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,20 +1,20 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import {
checkForBidirectionalRelationships,
relationshipToAPI,
} from "~database/entities/Relationship";
} from "~/database/entities/Relationship";
import {
getRelationshipToOtherUser,
sendFollowAccept,
} from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
} from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,20 +1,20 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, eq } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import {
checkForBidirectionalRelationships,
relationshipToAPI,
} from "~database/entities/Relationship";
} from "~/database/entities/Relationship";
import {
getRelationshipToOtherUser,
sendFollowReject,
} from "~database/entities/User";
import { db } from "~drizzle/db";
import { Relationships } from "~drizzle/schema";
import { User } from "~packages/database-interface/user";
} from "~/database/entities/User";
import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema";
import { User } from "~/packages/database-interface/user";
export const meta = applyConfig({
allowedMethods: ["POST"],

View file

@ -1,11 +1,11 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, gt, gte, lt, sql } from "drizzle-orm";
import type { Hono } from "hono";
import { z } from "zod";
import { Users } from "~drizzle/schema";
import { Timeline } from "~packages/database-interface/timeline";
import { Users } from "~/drizzle/schema";
import { Timeline } from "~/packages/database-interface/timeline";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,7 +1,7 @@
import { applyConfig } from "@api";
import { jsonResponse } from "@response";
import { applyConfig } from "@/api";
import { jsonResponse } from "@/response";
import type { Hono } from "hono";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { sendTestRequest } from "~tests/utils";
import { sendTestRequest } from "~/tests/utils";
import { meta } from "./extended_description";
// /api/v1/instance/extended_description

View file

@ -1,10 +1,10 @@
import { applyConfig, auth } from "@api";
import { dualLogger } from "@loggers";
import { jsonResponse } from "@response";
import { applyConfig, auth } from "@/api";
import { dualLogger } from "@/loggers";
import { jsonResponse } from "@/response";
import type { Hono } from "hono";
import { getMarkdownRenderer } from "~database/entities/Status";
import { config } from "~packages/config-manager";
import { LogLevel } from "~packages/log-manager";
import { getMarkdownRenderer } from "~/database/entities/Status";
import { config } from "~/packages/config-manager";
import { LogLevel } from "~/packages/log-manager";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,14 +1,14 @@
import { applyConfig, auth } from "@api";
import { jsonResponse, proxyUrl } from "@response";
import { applyConfig, auth } from "@/api";
import { jsonResponse, proxyUrl } from "@/response";
import { and, count, eq, isNull } from "drizzle-orm";
import type { Hono } from "hono";
import { db } from "~drizzle/db";
import { Instances, Users } from "~drizzle/schema";
import manifest from "~package.json";
import { config } from "~packages/config-manager";
import { Note } from "~packages/database-interface/note";
import { User } from "~packages/database-interface/user";
import type { Instance as APIInstance } from "~types/mastodon/instance";
import { db } from "~/drizzle/db";
import { Instances, Users } from "~/drizzle/schema";
import manifest from "~/package.json";
import { config } from "~/packages/config-manager";
import { Note } from "~/packages/database-interface/note";
import { User } from "~/packages/database-interface/user";
import type { Instance as APIInstance } from "~/types/mastodon/instance";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { sendTestRequest } from "~tests/utils";
import { sendTestRequest } from "~/tests/utils";
import { meta } from "./rules";
// /api/v1/instance/rules

View file

@ -1,7 +1,7 @@
import { applyConfig, auth } from "@api";
import { jsonResponse } from "@response";
import { applyConfig, auth } from "@/api";
import { jsonResponse } from "@/response";
import type { Hono } from "hono";
import { config } from "~packages/config-manager";
import { config } from "~/packages/config-manager";
export const meta = applyConfig({
allowedMethods: ["GET"],

View file

@ -1,6 +1,6 @@
import { afterAll, describe, expect, test } from "bun:test";
import { config } from "config-manager";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~tests/utils";
import { getTestStatuses, getTestUsers, sendTestRequest } from "~/tests/utils";
import { meta } from "./index";
const { users, tokens, deleteUsers } = await getTestUsers(1);

View file

@ -5,16 +5,16 @@ import {
idValidator,
qs,
qsQuery,
} from "@api";
} from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { and, count, eq } from "drizzle-orm";
import type { Hono } from "hono";
import { validator } from "hono/validator";
import { z } from "zod";
import { db } from "~drizzle/db";
import { Markers } from "~drizzle/schema";
import type { Marker as APIMarker } from "~types/mastodon/marker";
import { db } from "~/drizzle/db";
import { Markers } from "~/drizzle/schema";
import type { Marker as APIMarker } from "~/types/mastodon/marker";
export const meta = applyConfig({
allowedMethods: ["GET", "POST"],

View file

@ -1,6 +1,6 @@
import { applyConfig, auth, handleZodError, idValidator } from "@api";
import { applyConfig, auth, handleZodError, idValidator } from "@/api";
import { errorResponse, jsonResponse, response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse, response } from "@response";
import { config } from "config-manager";
import { eq } from "drizzle-orm";
import type { Hono } from "hono";
@ -8,9 +8,9 @@ import type { MediaBackend } from "media-manager";
import { MediaBackendType } from "media-manager";
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
import { z } from "zod";
import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db";
import { Attachments } from "~drizzle/schema";
import { attachmentToAPI, getUrl } from "~/database/entities/Attachment";
import { db } from "~/drizzle/db";
import { Attachments } from "~/drizzle/schema";
export const meta = applyConfig({
allowedMethods: ["GET", "PUT"],

View file

@ -1,6 +1,6 @@
import { applyConfig, auth, handleZodError } from "@api";
import { applyConfig, auth, handleZodError } from "@/api";
import { errorResponse, jsonResponse } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { errorResponse, jsonResponse } from "@response";
import { encode } from "blurhash";
import { config } from "config-manager";
import type { Hono } from "hono";
@ -9,9 +9,9 @@ import type { MediaBackend } from "media-manager";
import { LocalMediaBackend, S3MediaBackend } from "media-manager";
import sharp from "sharp";
import { z } from "zod";
import { attachmentToAPI, getUrl } from "~database/entities/Attachment";
import { db } from "~drizzle/db";
import { Attachments } from "~drizzle/schema";
import { attachmentToAPI, getUrl } from "~/database/entities/Attachment";
import { db } from "~/drizzle/db";
import { Attachments } from "~/drizzle/schema";
export const meta = applyConfig({
allowedMethods: ["POST"],

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