diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts index 127d730762..ded2786a26 100644 --- a/packages/backend/src/server/oauth/OAuth2ProviderService.ts +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -1,6 +1,5 @@ import dns from 'node:dns/promises'; import { fileURLToPath } from 'node:url'; -import { ServerResponse } from 'node:http'; import { Inject, Injectable } from '@nestjs/common'; import { JSDOM } from 'jsdom'; import httpLinkHeader from 'http-link-header'; @@ -19,12 +18,13 @@ import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import type { AccessTokensRepository, UsersRepository } from '@/models/index.js'; -import { IdService } from '@/core/IdService.js'; -import { CacheService } from '@/core/CacheService.js'; +import type { IdService } from '@/core/IdService.js'; +import type { CacheService } from '@/core/CacheService.js'; import type { LocalUser } from '@/models/entities/User.js'; import { MemoryKVCache } from '@/misc/cache.js'; -import { LoggerService } from '@/core/LoggerService.js'; +import type { LoggerService } from '@/core/LoggerService.js'; import Logger from '@/logger.js'; +import type { ServerResponse } from 'node:http'; import type { FastifyInstance } from 'fastify'; // Follows https://indieauth.spec.indieweb.org/#client-identifier diff --git a/packages/backend/test/e2e/oauth.ts b/packages/backend/test/e2e/oauth.ts index 8a11d1ff76..dbef0e457a 100644 --- a/packages/backend/test/e2e/oauth.ts +++ b/packages/backend/test/e2e/oauth.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import { AuthorizationCode, type AuthorizationTokenConfig } from 'simple-oauth2'; import pkceChallenge from 'pkce-challenge'; import { JSDOM } from 'jsdom'; -import * as misskey from 'misskey-js'; +import type * as misskey from 'misskey-js'; import Fastify, { type FastifyReply, type FastifyInstance } from 'fastify'; import { port, relativeFetch, signup, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; @@ -224,7 +224,7 @@ describe('OAuth', () => { }); assert.strictEqual(createResponse.status, 200); - const createResponseBody = await createResponse.json() as { createdNote: Note }; + const createResponseBody = await createResponse.json() as misskey.Endpoints['notes/create']['res']; assert.strictEqual(createResponseBody.createdNote.text, 'test'); }); @@ -303,10 +303,10 @@ describe('OAuth', () => { }); assert.strictEqual(createResponseAlice.status, 200); - const createResponseBodyAlice = await createResponseAlice.json() as { createdNote: misskey.entities.Note }; + const createResponseBodyAlice = await createResponseAlice.json() as misskey.Endpoints['notes/create']['res']; assert.strictEqual(createResponseBodyAlice.createdNote.user.username, 'alice'); - const createResponseBodyBob = await createResponseBob.json() as { createdNote: misskey.entities.Note }; + const createResponseBodyBob = await createResponseBob.json() as misskey.Endpoints['notes/create']['res']; assert.strictEqual(createResponseBodyBob.createdNote.user.username, 'bob'); });