diff --git a/packages/backend/src/misc/gen-id.ts b/packages/backend/src/misc/gen-id.ts index cf3f4f080f..e2d9b0201f 100644 --- a/packages/backend/src/misc/gen-id.ts +++ b/packages/backend/src/misc/gen-id.ts @@ -3,7 +3,7 @@ import { nativeCreateId, nativeInitIdGenerator, nativeGetTimestamp, -} from "backend-rs/built/index.js"; +} from "backend-rs"; const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24); const fingerprint = config.cuid?.fingerprint ?? ""; diff --git a/packages/backend/src/misc/secure-rndstr.ts b/packages/backend/src/misc/secure-rndstr.ts index 7c1505b7a3..f98985592b 100644 --- a/packages/backend/src/misc/secure-rndstr.ts +++ b/packages/backend/src/misc/secure-rndstr.ts @@ -1,4 +1,4 @@ -import { nativeRandomStr } from "backend-rs/built/index.js"; +import { nativeRandomStr } from "backend-rs"; export function secureRndstr(length = 32, _ = true): string { return nativeRandomStr(length); diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index b23813721a..1eb55a77e0 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -23,11 +23,7 @@ import verifyEmail from "./private/verify-email.js"; import { koaBody } from "koa-body"; import { convertAttachment } from "./mastodon/converters.js"; -// TODO?: should we avoid importing things from built directory? -import { - convertId, - IdConvertType as IdType, -} from "backend-rs/built/index.js"; +import { convertId, IdConvertType as IdType } from "backend-rs"; // re-export native rust id conversion (function and enum) export { IdType, convertId }; diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 2f16c66173..30f36b4653 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -2,8 +2,6 @@ process.env.NODE_ENV = "test"; import * as assert from "assert"; import { inspect } from "node:util"; -import { DEFAULT_POLICIES } from "@/core/RoleService.js"; -import type { Packed } from "@/misc/json-schema.js"; import { signup, post, @@ -12,10 +10,9 @@ import { startServer, api, successfulApiCall, - failedApiCall, uploadFile, } from "../utils.js"; -import type * as firefish from "firefish-js"; +import type { entities } from "firefish-js"; import type { INestApplicationContext } from "@nestjs/common"; describe("ユーザー", () => { @@ -34,16 +31,16 @@ describe("ユーザー", () => { }; // BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う - type UserLite = firefish.entities.UserLite & { + type UserLite = entities.UserLite & { badgeRoles: any[]; }; type UserDetailedNotMe = UserLite & - firefish.entities.UserDetailed & { + entities.UserDetailed & { roles: any[]; }; - type MeDetailed = UserDetailedNotMe & firefish.entities.MeDetailed; + type MeDetailed = UserDetailedNotMe & entities.MeDetailed; type User = MeDetailed & { token: string }; @@ -183,12 +180,12 @@ describe("ユーザー", () => { let root: User; let alice: User; - let aliceNote: firefish.entities.Note; - let alicePage: firefish.entities.Page; - let aliceList: firefish.entities.UserList; + let aliceNote: entities.Note; + let alicePage: entities.Page; + let aliceList: entities.UserList; let bob: User; - let bobNote: firefish.entities.Note; + let bobNote: entities.Note; let carol: User; let dave: User; diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 5cff65b03f..dfacd0738a 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -5,7 +5,7 @@ import * as http from "node:http"; import * as path from "node:path"; import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; -import * as firefish from "firefish-js"; +import type { endpoints, Entities } from "firefish-js"; import FormData from "form-data"; import got from "got"; import fetch from "node-fetch"; @@ -113,8 +113,8 @@ export const signup = async (params?: any): Promise => { export const post = async ( user: any, - params?: firefish.Endpoints["notes/create"]["req"], -): Promise => { + params?: Endpoints["notes/create"]["req"], +): Promise => { const q = Object.assign( { text: "test", diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index f2187dff9d..dbe219f838 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,4 +1,4 @@ -import type * as firefish from "firefish-js"; +import type { entities } from "firefish-js"; import { defineAsyncComponent } from "vue"; import { i18n } from "./i18n"; import { apiUrl } from "@/config"; @@ -10,7 +10,7 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; // TODO: 他のタブと永続化されたstateを同期 -export type Account = firefish.entities.MeDetailed; +export type Account = entities.MeDetailed; export async function signout() { waiting(); @@ -149,8 +149,8 @@ export async function openAccountMenu( opts: { includeCurrentAccount?: boolean; withExtraOperation: boolean; - active?: firefish.entities.UserDetailed["id"]; - onChoose?: (account: firefish.entities.UserDetailed) => void; + active?: entities.UserDetailed["id"]; + onChoose?: (account: entities.UserDetailed) => void; }, ev: MouseEvent, ) { @@ -182,7 +182,7 @@ export async function openAccountMenu( ); } - async function switchAccount(account: firefish.entities.UserDetailed) { + async function switchAccount(account: entities.UserDetailed) { const storedAccounts = await getAccounts(); const token = storedAccounts.find((x) => x.id === account.id).token; switchAccountWithToken(token); @@ -199,7 +199,7 @@ export async function openAccountMenu( userIds: storedAccounts.map((x) => x.id), }); - function createItem(account: firefish.entities.UserDetailed) { + function createItem(account: entities.UserDetailed) { return { type: "user", user: account, diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index 8d5675868b..bde54b7d7e 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -41,7 +41,7 @@ diff --git a/packages/client/src/components/MkDriveWindow.vue b/packages/client/src/components/MkDriveWindow.vue index f116b6e8f5..bdddcd2e52 100644 --- a/packages/client/src/components/MkDriveWindow.vue +++ b/packages/client/src/components/MkDriveWindow.vue @@ -14,14 +14,13 @@ diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 24e45b1558..194a72d4b1 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -191,7 +191,7 @@