refactor: 🚚 Explicitely add extensions to all imports

This commit is contained in:
Jesse Wierzbinski 2024-10-04 15:22:48 +02:00
parent b5b7014c00
commit b53307c824
No known key found for this signature in database
99 changed files with 168 additions and 169 deletions

View file

@ -5,7 +5,7 @@ import { db } from "~/drizzle/db";
import { Applications } from "~/drizzle/schema"; import { Applications } from "~/drizzle/schema";
import { config } from "~/packages/config-manager"; import { config } from "~/packages/config-manager";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, deleteUsers, passwords } = await getTestUsers(1); const { users, deleteUsers, passwords } = await getTestUsers(1);

View file

@ -5,7 +5,7 @@ import { db } from "~/drizzle/db";
import { Applications } from "~/drizzle/schema"; import { Applications } from "~/drizzle/schema";
import { config } from "~/packages/config-manager"; import { config } from "~/packages/config-manager";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, deleteUsers, passwords } = await getTestUsers(1); const { users, deleteUsers, passwords } = await getTestUsers(1);
const token = randomString(32, "hex"); const token = randomString(32, "hex");

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Relationship as ApiRelationship } from "@versia/client/types"; import type { Relationship as ApiRelationship } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./block"; import { meta } from "./block.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Relationship as ApiRelationship } from "@versia/client/types"; import type { Relationship as ApiRelationship } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./follow"; import { meta } from "./follow.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./followers"; import { meta } from "./followers.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./following"; import { meta } from "./following.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[0])).toReversed(); const timeline = (await getTestStatuses(40, users[0])).toReversed();

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Relationship as ApiRelationship } from "@versia/client/types"; import type { Relationship as ApiRelationship } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./mute"; import { meta } from "./mute.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Status as ApiStatus } from "@versia/client/types"; import type { Status as ApiStatus } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils.ts";
import { meta } from "./statuses"; import { meta } from "./statuses.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[1])).toReversed(); const timeline = (await getTestStatuses(40, users[1])).toReversed();

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Relationship as ApiRelationship } from "@versia/client/types"; import type { Relationship as ApiRelationship } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./unmute"; import { meta } from "./unmute.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, deleteUsers } = await getTestUsers(5); const { users, deleteUsers } = await getTestUsers(5);

View file

@ -4,7 +4,7 @@ import { eq } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Users } from "~/drizzle/schema"; import { Users } from "~/drizzle/schema";
import { fakeRequest, getSolvedChallenge } from "~/tests/utils"; import { fakeRequest, getSolvedChallenge } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const username = randomString(10, "hex"); const username = randomString(10, "hex");
const username2 = randomString(10, "hex"); const username2 = randomString(10, "hex");

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -3,7 +3,7 @@ import { eq } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Users } from "~/drizzle/schema"; import { Users } from "~/drizzle/schema";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -8,7 +8,7 @@ import { contentToHtml } from "~/classes/functions/status";
import { MediaManager } from "~/classes/media/media-manager"; import { MediaManager } from "~/classes/media/media-manager";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { EmojiToUser, RolePermissions, Users } from "~/drizzle/schema"; import { EmojiToUser, RolePermissions, Users } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { Emoji } from "~/packages/database-interface/emoji"; import { Emoji } from "~/packages/database-interface/emoji";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
// /api/v1/challenges // /api/v1/challenges
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -3,7 +3,7 @@ import { inArray } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema"; import { Emojis } from "~/drizzle/schema";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -3,7 +3,7 @@ import { inArray } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema"; import { Emojis } from "~/drizzle/schema";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);
let id = ""; let id = "";

View file

@ -4,7 +4,7 @@ import sharp from "sharp";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema"; import { Emojis } from "~/drizzle/schema";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(3); const { users, tokens, deleteUsers } = await getTestUsers(3);

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./extended_description"; import { meta } from "./extended_description.ts";
// /api/v1/instance/extended_description // /api/v1/instance/extended_description
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./privacy_policy"; import { meta } from "./privacy_policy.ts";
// /api/v1/instance/privacy_policy // /api/v1/instance/privacy_policy
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -1,7 +1,7 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./rules"; import { meta } from "./rules.ts";
// /api/v1/instance/rules // /api/v1/instance/rules
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./tos"; import { meta } from "./tos.ts";
// /api/v1/instance/tos // /api/v1/instance/tos
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -1,6 +1,6 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(1); const { users, tokens, deleteUsers } = await getTestUsers(1);
const timeline = await getTestStatuses(10, users[0]); const timeline = await getTestStatuses(10, users[0]);

View file

@ -3,7 +3,7 @@ import { createRoute } from "@hono/zod-openapi";
import { z } from "zod"; import { z } from "zod";
import { MediaManager } from "~/classes/media/media-manager"; import { MediaManager } from "~/classes/media/media-manager";
import { RolePermissions } from "~/drizzle/schema"; import { RolePermissions } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";

View file

@ -4,7 +4,7 @@ import sharp from "sharp";
import { z } from "zod"; import { z } from "zod";
import { MediaManager } from "~/classes/media/media-manager"; import { MediaManager } from "~/classes/media/media-manager";
import { RolePermissions } from "~/drizzle/schema"; import { RolePermissions } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";

View file

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

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Notification as ApiNotification } from "@versia/client/types"; import type { Notification as ApiNotification } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./dismiss"; import { meta } from "./dismiss.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);
let notifications: ApiNotification[] = []; let notifications: ApiNotification[] = [];

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Notification as ApiNotification } from "@versia/client/types"; import type { Notification as ApiNotification } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);
let notifications: ApiNotification[] = []; let notifications: ApiNotification[] = [];

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Notification as ApiNotification } from "@versia/client/types"; import type { Notification as ApiNotification } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);
let notifications: ApiNotification[] = []; let notifications: ApiNotification[] = [];

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Notification as ApiNotification } from "@versia/client/types"; import type { Notification as ApiNotification } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);
const statuses = await getTestStatuses(40, users[0]); const statuses = await getTestStatuses(40, users[0]);

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Notification as ApiNotification } from "@versia/client/types"; import type { Notification as ApiNotification } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const getFormData = (object: Record<string, string | number | boolean>) => const getFormData = (object: Record<string, string | number | boolean>) =>
Object.keys(object).reduce((formData, key) => { Object.keys(object).reduce((formData, key) => {

View file

@ -2,7 +2,7 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { ADMIN_ROLES, DEFAULT_ROLES, RolePermissions } from "~/drizzle/schema"; import { ADMIN_ROLES, DEFAULT_ROLES, RolePermissions } from "~/drizzle/schema";
import { Role } from "~/packages/database-interface/role"; import { Role } from "~/packages/database-interface/role";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(1); const { users, tokens, deleteUsers } = await getTestUsers(1);
let role: Role; let role: Role;

View file

@ -1,9 +1,9 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { ADMIN_ROLES } from "~/drizzle/schema"; import { ADMIN_ROLES } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Role } from "~/packages/database-interface/role"; import { Role } from "~/packages/database-interface/role";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, deleteUsers, tokens } = await getTestUsers(1); const { users, deleteUsers, tokens } = await getTestUsers(1);
let role: Role; let role: Role;

View file

@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Status as ApiStatus } from "@versia/client/types"; import type { Status as ApiStatus } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./favourite"; import { meta } from "./favourite.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(2, users[0])).toReversed(); const timeline = (await getTestStatuses(2, users[0])).toReversed();

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./favourited_by"; import { meta } from "./favourited_by.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[0])).toReversed(); const timeline = (await getTestStatuses(40, users[0])).toReversed();

View file

@ -3,7 +3,7 @@ import { createRoute } from "@hono/zod-openapi";
import ISO6391 from "iso-639-1"; import ISO6391 from "iso-639-1";
import { z } from "zod"; import { z } from "zod";
import { RolePermissions } from "~/drizzle/schema"; import { RolePermissions } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { Note } from "~/packages/database-interface/note"; import { Note } from "~/packages/database-interface/note";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Account as ApiAccount } from "@versia/client/types"; import type { Account as ApiAccount } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./reblogged_by"; import { meta } from "./reblogged_by.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[0])).toReversed(); const timeline = (await getTestStatuses(40, users[0])).toReversed();

View file

@ -1,7 +1,7 @@
import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import type { Status as ApiStatus } from "@versia/client/types"; import type { Status as ApiStatus } from "@versia/client/types";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./unfavourite"; import { meta } from "./unfavourite.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(2, users[0])).toReversed(); const timeline = (await getTestStatuses(2, users[0])).toReversed();

View file

@ -3,9 +3,9 @@ import type { Status as ApiStatus } from "@versia/client/types";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema"; import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);

View file

@ -3,7 +3,7 @@ import { createRoute } from "@hono/zod-openapi";
import ISO6391 from "iso-639-1"; import ISO6391 from "iso-639-1";
import { z } from "zod"; import { z } from "zod";
import { RolePermissions } from "~/drizzle/schema"; import { RolePermissions } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { Note } from "~/packages/database-interface/note"; import { Note } from "~/packages/database-interface/note";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";

View file

@ -1,8 +1,8 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Status as ApiStatus } from "@versia/client/types"; import type { Status as ApiStatus } from "@versia/client/types";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./home"; import { meta } from "./home.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[0])).toReversed(); const timeline = (await getTestStatuses(40, users[0])).toReversed();

View file

@ -1,8 +1,8 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import type { Status as ApiStatus } from "@versia/client/types"; import type { Status as ApiStatus } from "@versia/client/types";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestStatuses, getTestUsers } from "~/tests/utils";
import { meta } from "./public"; import { meta } from "./public.ts";
const { users, tokens, deleteUsers } = await getTestUsers(5); const { users, tokens, deleteUsers } = await getTestUsers(5);
const timeline = (await getTestStatuses(40, users[0])).toReversed(); const timeline = (await getTestStatuses(40, users[0])).toReversed();

View file

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

View file

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

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { fakeRequest } from "~/tests/utils"; import { fakeRequest } from "~/tests/utils";
import { meta } from "./index"; import { meta } from "./index.ts";
// /api/v2/instance // /api/v2/instance
describe(meta.route, () => { describe(meta.route, () => {

View file

@ -4,7 +4,7 @@ import sharp from "sharp";
import { z } from "zod"; import { z } from "zod";
import { MediaManager } from "~/classes/media/media-manager"; import { MediaManager } from "~/classes/media/media-manager";
import { RolePermissions } from "~/drizzle/schema"; import { RolePermissions } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Attachment } from "~/packages/database-interface/attachment"; import { Attachment } from "~/packages/database-interface/attachment";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";

18
app.ts
View file

@ -13,15 +13,15 @@ import { getLogger } from "@logtape/logtape";
import chalk from "chalk"; import chalk from "chalk";
import type { ValidationError } from "zod-validation-error"; import type { ValidationError } from "zod-validation-error";
import pkg from "~/package.json" with { type: "application/json" }; import pkg from "~/package.json" with { type: "application/json" };
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { PluginLoader } from "./classes/plugin/loader"; import { PluginLoader } from "./classes/plugin/loader.ts";
import { agentBans } from "./middlewares/agent-bans"; import { agentBans } from "./middlewares/agent-bans.ts";
import { bait } from "./middlewares/bait"; import { bait } from "./middlewares/bait.ts";
import { boundaryCheck } from "./middlewares/boundary-check"; import { boundaryCheck } from "./middlewares/boundary-check.ts";
import { ipBans } from "./middlewares/ip-bans"; import { ipBans } from "./middlewares/ip-bans.ts";
import { logger } from "./middlewares/logger"; import { logger } from "./middlewares/logger.ts";
import { routes } from "./routes"; import { routes } from "./routes.ts";
import type { ApiRouteExports, HonoEnv } from "./types/api"; import type { ApiRouteExports, HonoEnv } from "./types/api.ts";
export const appFactory = async () => { export const appFactory = async () => {
await configureLoggers(); await configureLoggers();

View file

@ -9,7 +9,6 @@
"all": true, "all": true,
"correctness": { "correctness": {
"noNodejsModules": "off", "noNodejsModules": "off",
"useImportExtensions": "off",
"noUndeclaredDependencies": "off" "noUndeclaredDependencies": "off"
}, },
"performance": { "performance": {

View file

@ -2,7 +2,7 @@ import type { LikeExtension } from "@versia/federation/types";
import { type InferSelectModel, and, eq } from "drizzle-orm"; import { type InferSelectModel, and, eq } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Likes, Notifications } from "~/drizzle/schema"; import { Likes, Notifications } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import type { Note } from "~/packages/database-interface/note"; import type { Note } from "~/packages/database-interface/note";
import type { User } from "~/packages/database-interface/user"; import type { User } from "~/packages/database-interface/user";

View file

@ -4,13 +4,13 @@ import { db } from "~/drizzle/db";
import type { Notifications } from "~/drizzle/schema"; import type { Notifications } from "~/drizzle/schema";
import { Note } from "~/packages/database-interface/note"; import { Note } from "~/packages/database-interface/note";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";
import type { StatusWithRelations } from "./status"; import type { StatusWithRelations } from "./status.ts";
import { import {
type UserWithRelations, type UserWithRelations,
transformOutputToUserWithRelations, transformOutputToUserWithRelations,
userExtrasTemplate, userExtrasTemplate,
userRelations, userRelations,
} from "./user"; } from "./user.ts";
export type Notification = InferSelectModel<typeof Notifications>; export type Notification = InferSelectModel<typeof Notifications>;

View file

@ -31,17 +31,17 @@ import {
type Notes, type Notes,
Users, Users,
} from "~/drizzle/schema"; } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import type { EmojiWithInstance } from "~/packages/database-interface/emoji"; import type { EmojiWithInstance } from "~/packages/database-interface/emoji";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";
import type { Application } from "./application"; import type { Application } from "./application.ts";
import { import {
type UserWithInstance, type UserWithInstance,
type UserWithRelations, type UserWithRelations,
transformOutputToUserWithRelations, transformOutputToUserWithRelations,
userExtrasTemplate, userExtrasTemplate,
userRelations, userRelations,
} from "./user"; } from "./user.ts";
export type Status = InferSelectModel<typeof Notes>; export type Status = InferSelectModel<typeof Notes>;

View file

@ -14,8 +14,8 @@ import {
} from "~/drizzle/schema"; } from "~/drizzle/schema";
import type { EmojiWithInstance } from "~/packages/database-interface/emoji"; import type { EmojiWithInstance } from "~/packages/database-interface/emoji";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";
import type { Application } from "./application"; import type { Application } from "./application.ts";
import type { Token } from "./token"; import type { Token } from "./token.ts";
export type UserType = InferSelectModel<typeof Users>; export type UserType = InferSelectModel<typeof Users>;

View file

@ -15,8 +15,8 @@ import {
import { rm } from "node:fs/promises"; import { rm } from "node:fs/promises";
import { join } from "node:path"; import { join } from "node:path";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import type { getMediaHash } from "../media-hasher"; import type { getMediaHash } from "../media-hasher.ts";
import { DiskMediaDriver } from "./disk"; import { DiskMediaDriver } from "./disk.ts";
describe("DiskMediaDriver", () => { describe("DiskMediaDriver", () => {
let diskDriver: DiskMediaDriver; let diskDriver: DiskMediaDriver;

View file

@ -6,9 +6,9 @@
import { rm } from "node:fs/promises"; import { rm } from "node:fs/promises";
import { join } from "node:path"; import { join } from "node:path";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import { getMediaHash } from "../media-hasher"; import { getMediaHash } from "../media-hasher.ts";
import type { UploadedFileMetadata } from "../media-manager"; import type { UploadedFileMetadata } from "../media-manager.ts";
import type { MediaDriver } from "./media-driver"; import type { MediaDriver } from "./media-driver.ts";
/** /**
* Implements the MediaDriver interface for disk storage. * Implements the MediaDriver interface for disk storage.

View file

@ -3,7 +3,7 @@
* @module MediaManager/Drivers * @module MediaManager/Drivers
*/ */
import type { UploadedFileMetadata } from "../media-manager"; import type { UploadedFileMetadata } from "../media-manager.ts";
/** /**
* Represents a media storage driver. * Represents a media storage driver.

View file

@ -6,8 +6,8 @@
import { type Mock, beforeEach, describe, expect, it, mock } from "bun:test"; import { type Mock, beforeEach, describe, expect, it, mock } from "bun:test";
import type { S3Client } from "@bradenmacdonald/s3-lite-client"; import type { S3Client } from "@bradenmacdonald/s3-lite-client";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import type { getMediaHash } from "../media-hasher"; import type { getMediaHash } from "../media-hasher.ts";
import { S3MediaDriver } from "./s3"; import { S3MediaDriver } from "./s3.ts";
describe("S3MediaDriver", () => { describe("S3MediaDriver", () => {
let s3Driver: S3MediaDriver; let s3Driver: S3MediaDriver;

View file

@ -5,9 +5,9 @@
import { S3Client } from "@bradenmacdonald/s3-lite-client"; import { S3Client } from "@bradenmacdonald/s3-lite-client";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import { getMediaHash } from "../media-hasher"; import { getMediaHash } from "../media-hasher.ts";
import type { UploadedFileMetadata } from "../media-manager"; import type { UploadedFileMetadata } from "../media-manager.ts";
import type { MediaDriver } from "./media-driver"; import type { MediaDriver } from "./media-driver.ts";
/** /**
* Implements the MediaDriver interface for S3 storage. * Implements the MediaDriver interface for S3 storage.

View file

@ -6,10 +6,10 @@
import { beforeEach, describe, expect, it, mock } from "bun:test"; import { beforeEach, describe, expect, it, mock } from "bun:test";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import { MediaBackendType } from "~/packages/config-manager/config.type"; import { MediaBackendType } from "~/packages/config-manager/config.type";
import { DiskMediaDriver } from "./drivers/disk"; import { DiskMediaDriver } from "./drivers/disk.ts";
import { S3MediaDriver } from "./drivers/s3"; import { S3MediaDriver } from "./drivers/s3.ts";
import { MediaManager } from "./media-manager"; import { MediaManager } from "./media-manager.ts";
import type { ImageConversionPreprocessor } from "./preprocessors/image-conversion"; import type { ImageConversionPreprocessor } from "./preprocessors/image-conversion.ts";
describe("MediaManager", () => { describe("MediaManager", () => {
let mediaManager: MediaManager; let mediaManager: MediaManager;

View file

@ -4,12 +4,12 @@
*/ */
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import { DiskMediaDriver } from "./drivers/disk"; import { DiskMediaDriver } from "./drivers/disk.ts";
import type { MediaDriver } from "./drivers/media-driver"; import type { MediaDriver } from "./drivers/media-driver.ts";
import { S3MediaDriver } from "./drivers/s3"; import { S3MediaDriver } from "./drivers/s3.ts";
import { BlurhashPreprocessor } from "./preprocessors/blurhash"; import { BlurhashPreprocessor } from "./preprocessors/blurhash.ts";
import { ImageConversionPreprocessor } from "./preprocessors/image-conversion"; import { ImageConversionPreprocessor } from "./preprocessors/image-conversion.ts";
import type { MediaPreprocessor } from "./preprocessors/media-preprocessor"; import type { MediaPreprocessor } from "./preprocessors/media-preprocessor.ts";
/** /**
* Manages media operations with support for different storage drivers and preprocessing plugins. * Manages media operations with support for different storage drivers and preprocessing plugins.

View file

@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, mock } from "bun:test"; import { beforeEach, describe, expect, it, mock } from "bun:test";
import sharp from "sharp"; import sharp from "sharp";
import { BlurhashPreprocessor } from "./blurhash"; import { BlurhashPreprocessor } from "./blurhash.ts";
describe("BlurhashPreprocessor", () => { describe("BlurhashPreprocessor", () => {
let preprocessor: BlurhashPreprocessor; let preprocessor: BlurhashPreprocessor;

View file

@ -1,6 +1,6 @@
import { encode } from "blurhash"; import { encode } from "blurhash";
import sharp from "sharp"; import sharp from "sharp";
import type { MediaPreprocessor } from "./media-preprocessor"; import type { MediaPreprocessor } from "./media-preprocessor.ts";
export class BlurhashPreprocessor implements MediaPreprocessor { export class BlurhashPreprocessor implements MediaPreprocessor {
public async process( public async process(

View file

@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it } from "bun:test"; import { beforeEach, describe, expect, it } from "bun:test";
import sharp from "sharp"; import sharp from "sharp";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import { ImageConversionPreprocessor } from "./image-conversion"; import { ImageConversionPreprocessor } from "./image-conversion.ts";
describe("ImageConversionPreprocessor", () => { describe("ImageConversionPreprocessor", () => {
let preprocessor: ImageConversionPreprocessor; let preprocessor: ImageConversionPreprocessor;

View file

@ -5,7 +5,7 @@
import sharp from "sharp"; import sharp from "sharp";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import type { MediaPreprocessor } from "./media-preprocessor"; import type { MediaPreprocessor } from "./media-preprocessor.ts";
/** /**
* Supported input media formats. * Supported input media formats.

View file

@ -10,7 +10,7 @@ import {
import { ZodError, type ZodTypeAny, z } from "zod"; import { ZodError, type ZodTypeAny, z } from "zod";
import { Plugin } from "~/packages/plugin-kit"; import { Plugin } from "~/packages/plugin-kit";
import { type Manifest, manifestSchema } from "~/packages/plugin-kit/schema"; import { type Manifest, manifestSchema } from "~/packages/plugin-kit/schema";
import { PluginLoader } from "./loader"; import { PluginLoader } from "./loader.ts";
const mockReaddir = jest.fn(); const mockReaddir = jest.fn();
const mockGetLogger = jest.fn(() => ({ const mockGetLogger = jest.fn(() => ({

View file

@ -6,7 +6,7 @@ import { db } from "~/drizzle/db";
import { Emojis, Instances, Users } from "~/drizzle/schema"; import { Emojis, Instances, Users } from "~/drizzle/schema";
import { Instance } from "~/packages/database-interface/instance"; import { Instance } from "~/packages/database-interface/instance";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";
import { BaseCommand } from "./base"; import { BaseCommand } from "./base.ts";
export type FlagsType<T extends typeof Command> = Interfaces.InferredFlags< export type FlagsType<T extends typeof Command> = Interfaces.InferredFlags<
(typeof BaseCommand)["baseFlags"] & T["flags"] (typeof BaseCommand)["baseFlags"] & T["flags"]

View file

@ -1,19 +1,19 @@
import { configureLoggers } from "@/loggers"; import { configureLoggers } from "@/loggers";
import { execute } from "@oclif/core"; import { execute } from "@oclif/core";
import EmojiAdd from "./commands/emoji/add"; import EmojiAdd from "./commands/emoji/add.ts";
import EmojiDelete from "./commands/emoji/delete"; import EmojiDelete from "./commands/emoji/delete.ts";
import EmojiImport from "./commands/emoji/import"; import EmojiImport from "./commands/emoji/import.ts";
import EmojiList from "./commands/emoji/list"; import EmojiList from "./commands/emoji/list.ts";
import FederationInstanceFetch from "./commands/federation/instance/fetch"; import FederationInstanceFetch from "./commands/federation/instance/fetch.ts";
import FederationUserFetch from "./commands/federation/user/fetch"; import FederationUserFetch from "./commands/federation/user/fetch.ts";
import FederationUserFinger from "./commands/federation/user/finger"; import FederationUserFinger from "./commands/federation/user/finger.ts";
import IndexRebuild from "./commands/index/rebuild"; import IndexRebuild from "./commands/index/rebuild.ts";
import Start from "./commands/start"; import Start from "./commands/start.ts";
import UserCreate from "./commands/user/create"; import UserCreate from "./commands/user/create.ts";
import UserDelete from "./commands/user/delete"; import UserDelete from "./commands/user/delete.ts";
import UserList from "./commands/user/list"; import UserList from "./commands/user/list.ts";
import UserRefetch from "./commands/user/refetch"; import UserRefetch from "./commands/user/refetch.ts";
import UserReset from "./commands/user/reset"; import UserReset from "./commands/user/reset.ts";
await configureLoggers(); await configureLoggers();

View file

@ -1,5 +1,5 @@
import type { Config } from "drizzle-kit"; import type { Config } from "drizzle-kit";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
export default { export default {
dialect: "postgresql", dialect: "postgresql",

View file

@ -5,7 +5,7 @@ import { withReplicas } from "drizzle-orm/pg-core";
import { migrate } from "drizzle-orm/postgres-js/migrator"; import { migrate } from "drizzle-orm/postgres-js/migrator";
import { Pool } from "pg"; import { Pool } from "pg";
import { config } from "~/packages/config-manager"; import { config } from "~/packages/config-manager";
import * as schema from "./schema"; import * as schema from "./schema.ts";
const primaryDb = new Pool({ const primaryDb = new Pool({
host: config.database.host, host: config.database.host,

View file

@ -2,7 +2,7 @@ import cluster from "node:cluster";
import { sentry } from "@/sentry"; import { sentry } from "@/sentry";
import { createServer } from "@/server"; import { createServer } from "@/server";
import { appFactory } from "~/app"; import { appFactory } from "~/app";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
process.on("SIGINT", () => { process.on("SIGINT", () => {
process.exit(); process.exit();
@ -12,7 +12,7 @@ if (cluster.isPrimary) {
for (let i = 0; i < Number(process.env.NUM_CPUS ?? 1); i++) { for (let i = 0; i < Number(process.env.NUM_CPUS ?? 1); i++) {
cluster.fork(); cluster.fork();
} }
await import("./setup"); await import("./setup.ts");
sentry?.captureMessage("Server started", "info"); sentry?.captureMessage("Server started", "info");
} else { } else {
createServer(config, await appFactory()); createServer(config, await appFactory());

View file

@ -13,8 +13,8 @@ import { z } from "zod";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Attachments } from "~/drizzle/schema"; import { Attachments } from "~/drizzle/schema";
import { MediaBackendType } from "~/packages/config-manager/config.type"; import { MediaBackendType } from "~/packages/config-manager/config.type";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
export type AttachmentType = InferSelectModel<typeof Attachments>; export type AttachmentType = InferSelectModel<typeof Attachments>;

View file

@ -14,8 +14,8 @@ import {
import { z } from "zod"; import { z } from "zod";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Emojis, Instances } from "~/drizzle/schema"; import { Emojis, Instances } from "~/drizzle/schema";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
import { Instance } from "./instance"; import { Instance } from "./instance.ts";
export type EmojiWithInstance = InferSelectModel<typeof Emojis> & { export type EmojiWithInstance = InferSelectModel<typeof Emojis> & {
instance: InferSelectModel<typeof Instances> | null; instance: InferSelectModel<typeof Instances> | null;

View file

@ -17,9 +17,9 @@ import {
} from "drizzle-orm"; } from "drizzle-orm";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Instances } from "~/drizzle/schema"; import { Instances } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
import { User } from "./user"; import { User } from "./user.ts";
export type AttachmentType = InferSelectModel<typeof Instances>; export type AttachmentType = InferSelectModel<typeof Instances>;

View file

@ -48,10 +48,10 @@ import {
Users, Users,
} from "~/drizzle/schema"; } from "~/drizzle/schema";
import { config } from "~/packages/config-manager"; import { config } from "~/packages/config-manager";
import { Attachment } from "./attachment"; import { Attachment } from "./attachment.ts";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
import { Emoji } from "./emoji"; import { Emoji } from "./emoji.ts";
import { User } from "./user"; import { User } from "./user.ts";
/** /**
* Gives helpers to fetch notes from database in a nice format * Gives helpers to fetch notes from database in a nice format

View file

@ -11,8 +11,8 @@ import {
import { z } from "zod"; import { z } from "zod";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Relationships } from "~/drizzle/schema"; import { Relationships } from "~/drizzle/schema";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
import type { User } from "./user"; import type { User } from "./user.ts";
export type RelationshipType = InferSelectModel<typeof Relationships>; export type RelationshipType = InferSelectModel<typeof Relationships>;

View file

@ -12,8 +12,8 @@ import {
import { z } from "zod"; import { z } from "zod";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { RoleToUsers, Roles } from "~/drizzle/schema"; import { RoleToUsers, Roles } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
export type RoleType = InferSelectModel<typeof Roles>; export type RoleType = InferSelectModel<typeof Roles>;

View file

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

View file

@ -54,12 +54,12 @@ import {
} from "~/drizzle/schema"; } from "~/drizzle/schema";
import { type Config, config } from "~/packages/config-manager"; import { type Config, config } from "~/packages/config-manager";
import type { KnownEntity } from "~/types/api.ts"; import type { KnownEntity } from "~/types/api.ts";
import { BaseInterface } from "./base"; import { BaseInterface } from "./base.ts";
import { Emoji } from "./emoji"; import { Emoji } from "./emoji.ts";
import { Instance } from "./instance"; import { Instance } from "./instance.ts";
import type { Note } from "./note"; import type { Note } from "./note.ts";
import { Relationship } from "./relationship"; import { Relationship } from "./relationship.ts";
import { Role } from "./role"; import { Role } from "./role.ts";
/** /**
* Gives helpers to fetch users from database in a nice format * Gives helpers to fetch users from database in a nice format

View file

@ -1,6 +1,6 @@
import { z } from "zod"; import { z } from "zod";
import { Hooks } from "./hooks"; import { Hooks } from "./hooks.ts";
import { Plugin } from "./plugin"; import { Plugin } from "./plugin.ts";
const myPlugin = new Plugin( const myPlugin = new Plugin(
z.object({ z.object({

View file

@ -1,6 +1,6 @@
import { Hooks } from "./hooks"; import { Hooks } from "./hooks.ts";
import { Plugin } from "./plugin"; import { Plugin } from "./plugin.ts";
import type { Manifest } from "./schema"; import type { Manifest } from "./schema.ts";
export type { Manifest }; export type { Manifest };
export { Plugin, Hooks }; export { Plugin, Hooks };

View file

@ -1,5 +1,5 @@
import { zodToJsonSchema } from "zod-to-json-schema"; import { zodToJsonSchema } from "zod-to-json-schema";
import { manifestSchema } from "./schema"; import { manifestSchema } from "./schema.ts";
const jsonSchema = zodToJsonSchema(manifestSchema); const jsonSchema = zodToJsonSchema(manifestSchema);

View file

@ -3,7 +3,7 @@ import type { OpenAPIHono } from "@hono/zod-openapi";
import type { z } from "zod"; import type { z } from "zod";
import { type ZodError, fromZodError } from "zod-validation-error"; import { type ZodError, fromZodError } from "zod-validation-error";
import type { HonoEnv } from "~/types/api"; import type { HonoEnv } from "~/types/api";
import type { ServerHooks } from "./hooks"; import type { ServerHooks } from "./hooks.ts";
export type HonoPluginEnv<ConfigType extends z.ZodTypeAny> = HonoEnv & { export type HonoPluginEnv<ConfigType extends z.ZodTypeAny> = HonoEnv & {
Variables: { Variables: {

View file

@ -1,10 +1,10 @@
import { Hooks, Plugin } from "@versia/kit"; import { Hooks, Plugin } from "@versia/kit";
import { z } from "zod"; import { z } from "zod";
import authorizeRoute from "./routes/authorize"; import authorizeRoute from "./routes/authorize.ts";
import tokenRevokeRoute from "./routes/oauth/revoke"; import tokenRevokeRoute from "./routes/oauth/revoke.ts";
import tokenRoute from "./routes/oauth/token"; import tokenRoute from "./routes/oauth/token.ts";
import ssoRoute from "./routes/sso"; import ssoIdRoute from "./routes/sso/:id/index.ts";
import ssoIdRoute from "./routes/sso/:id/index"; import ssoRoute from "./routes/sso/index.ts";
const plugin = new Plugin( const plugin = new Plugin(
z.object({ z.object({

View file

@ -7,7 +7,7 @@ import { JOSEError } from "jose/errors";
import { z } from "zod"; import { z } from "zod";
import { TokenType } from "~/classes/functions/token"; import { TokenType } from "~/classes/functions/token";
import { User } from "~/packages/database-interface/user"; import { User } from "~/packages/database-interface/user";
import type { PluginType } from "../index"; import type { PluginType } from "../index.ts";
const schemas = { const schemas = {
query: z.object({ query: z.object({

View file

@ -3,7 +3,7 @@ import { createRoute, z } from "@hono/zod-openapi";
import { db } from "@versia/kit/db"; import { db } from "@versia/kit/db";
import { eq } from "@versia/kit/drizzle"; import { eq } from "@versia/kit/drizzle";
import { Tokens } from "@versia/kit/tables"; import { Tokens } from "@versia/kit/tables";
import type { PluginType } from "../.."; import type { PluginType } from "../../index.ts";
export const schemas = { export const schemas = {
json: z.object({ json: z.object({

View file

@ -3,7 +3,7 @@ import { createRoute, z } from "@hono/zod-openapi";
import { db } from "@versia/kit/db"; import { db } from "@versia/kit/db";
import { eq } from "@versia/kit/drizzle"; import { eq } from "@versia/kit/drizzle";
import { Tokens } from "@versia/kit/tables"; import { Tokens } from "@versia/kit/tables";
import type { PluginType } from "../.."; import type { PluginType } from "../../index.ts";
export const schemas = { export const schemas = {
json: z.object({ json: z.object({

View file

@ -11,8 +11,8 @@ import {
} from "oauth4webapi"; } from "oauth4webapi";
import { z } from "zod"; import { z } from "zod";
import { ErrorSchema } from "~/types/api"; import { ErrorSchema } from "~/types/api";
import type { PluginType } from "../.."; import type { PluginType } from "../../index.ts";
import { oauthDiscoveryRequest, oauthRedirectUri } from "../../utils"; import { oauthDiscoveryRequest, oauthRedirectUri } from "../../utils.ts";
export default (plugin: PluginType) => { export default (plugin: PluginType) => {
plugin.registerRoute("/api/v1/sso", (app) => { plugin.registerRoute("/api/v1/sso", (app) => {

View file

@ -2,9 +2,9 @@ import { checkConfig } from "@/init";
import { configureLoggers } from "@/loggers"; import { configureLoggers } from "@/loggers";
import { getLogger } from "@logtape/logtape"; import { getLogger } from "@logtape/logtape";
import { setupDatabase } from "~/drizzle/db"; import { setupDatabase } from "~/drizzle/db";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { Note } from "~/packages/database-interface/note"; import { Note } from "~/packages/database-interface/note";
import { searchManager } from "./classes/search/search-manager"; import { searchManager } from "./classes/search/search-manager.ts";
const timeAtStart = performance.now(); const timeAtStart = performance.now();

View file

@ -1,5 +1,5 @@
import { afterAll, describe, expect, test } from "bun:test"; import { afterAll, describe, expect, test } from "bun:test";
import { fakeRequest, getTestUsers } from "./utils"; import { fakeRequest, getTestUsers } from "./utils.ts";
const { tokens, deleteUsers } = await getTestUsers(1); const { tokens, deleteUsers } = await getTestUsers(1);

View file

@ -6,7 +6,7 @@ import type {
Account as ApiAccount, Account as ApiAccount,
Relationship as ApiRelationship, Relationship as ApiRelationship,
} from "@versia/client/types"; } from "@versia/client/types";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import { fakeRequest, getTestUsers } from "~/tests/utils"; import { fakeRequest, getTestUsers } from "~/tests/utils";
const { users, tokens, deleteUsers } = await getTestUsers(2); const { users, tokens, deleteUsers } = await getTestUsers(2);

View file

@ -6,7 +6,7 @@ import type {
Application as ApiApplication, Application as ApiApplication,
Token as ApiToken, Token as ApiToken,
} from "@versia/client/types"; } from "@versia/client/types";
import { fakeRequest, getTestUsers } from "./utils"; import { fakeRequest, getTestUsers } from "./utils.ts";
let clientId: string; let clientId: string;
let clientSecret: string; let clientSecret: string;

View file

@ -1,5 +1,5 @@
import { setupDatabase } from "~/drizzle/db"; import { setupDatabase } from "~/drizzle/db";
import { deleteOldTestUsers } from "./utils"; import { deleteOldTestUsers } from "./utils.ts";
await setupDatabase(); await setupDatabase();
await deleteOldTestUsers(); await deleteOldTestUsers();

View file

@ -26,7 +26,7 @@ import type { Application } from "~/classes/functions/application";
import { type AuthData, getFromHeader } from "~/classes/functions/user"; import { type AuthData, getFromHeader } from "~/classes/functions/user";
import { db } from "~/drizzle/db"; import { db } from "~/drizzle/db";
import { Challenges } from "~/drizzle/schema"; import { Challenges } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
import type { User } from "~/packages/database-interface/user"; import type { User } from "~/packages/database-interface/user";
import type { ApiRouteMetadata, HonoEnv, HttpVerb } from "~/types/api"; import type { ApiRouteMetadata, HonoEnv, HttpVerb } from "~/types/api";

View file

@ -1,4 +1,4 @@
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
export const oauthRedirectUri = (issuer: string) => export const oauthRedirectUri = (issuer: string) =>
new URL(`/oauth/sso/${issuer}/callback`, config.http.base_url).toString(); new URL(`/oauth/sso/${issuer}/callback`, config.http.base_url).toString();

View file

@ -1,6 +1,6 @@
import { getLogger } from "@logtape/logtape"; import { getLogger } from "@logtape/logtape";
import { markdownParse } from "~/classes/functions/status"; import { markdownParse } from "~/classes/functions/status";
import { sentry } from "./sentry"; import { sentry } from "./sentry.ts";
export const renderMarkdownInPath = async ( export const renderMarkdownInPath = async (
path: string, path: string,

View file

@ -1,6 +1,6 @@
import * as Sentry from "@sentry/bun"; import * as Sentry from "@sentry/bun";
import pkg from "~/package.json"; import pkg from "~/package.json";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
const sentryInstance = const sentryInstance =
config.logging.sentry.enabled && config.logging.sentry.enabled &&

View file

@ -1,7 +1,7 @@
import type { OpenAPIHono } from "@hono/zod-openapi"; import type { OpenAPIHono } from "@hono/zod-openapi";
import type { Config } from "~/packages/config-manager/config.type"; import type { Config } from "~/packages/config-manager/config.type";
import type { HonoEnv } from "~/types/api"; import type { HonoEnv } from "~/types/api";
import { debugResponse } from "./api"; import { debugResponse } from "./api.ts";
export const createServer = (config: Config, app: OpenAPIHono<HonoEnv>) => export const createServer = (config: Config, app: OpenAPIHono<HonoEnv>) =>
Bun.serve({ Bun.serve({

View file

@ -5,7 +5,7 @@ import type {
import type { Status, findManyNotes } from "~/classes/functions/status"; import type { Status, findManyNotes } from "~/classes/functions/status";
import type { UserType, findManyUsers } from "~/classes/functions/user"; import type { UserType, findManyUsers } from "~/classes/functions/user";
import type { db } from "~/drizzle/db"; import type { db } from "~/drizzle/db";
import { config } from "~/packages/config-manager/index"; import { config } from "~/packages/config-manager/index.ts";
export async function fetchTimeline<T extends UserType | Status | Notification>( export async function fetchTimeline<T extends UserType | Status | Notification>(
model: model: