mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 16:43:08 +02:00
import changes
This commit is contained in:
parent
260ac0ecfc
commit
52e7bdd817
2 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
import dns from 'node:dns/promises';
|
import dns from 'node:dns/promises';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { ServerResponse } from 'node:http';
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { JSDOM } from 'jsdom';
|
import { JSDOM } from 'jsdom';
|
||||||
import httpLinkHeader from 'http-link-header';
|
import httpLinkHeader from 'http-link-header';
|
||||||
|
@ -19,12 +18,13 @@ import type { Config } from '@/config.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import type { AccessTokensRepository, UsersRepository } from '@/models/index.js';
|
import type { AccessTokensRepository, UsersRepository } from '@/models/index.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import type { IdService } from '@/core/IdService.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import type { CacheService } from '@/core/CacheService.js';
|
||||||
import type { LocalUser } from '@/models/entities/User.js';
|
import type { LocalUser } from '@/models/entities/User.js';
|
||||||
import { MemoryKVCache } from '@/misc/cache.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 Logger from '@/logger.js';
|
||||||
|
import type { ServerResponse } from 'node:http';
|
||||||
import type { FastifyInstance } from 'fastify';
|
import type { FastifyInstance } from 'fastify';
|
||||||
|
|
||||||
// Follows https://indieauth.spec.indieweb.org/#client-identifier
|
// Follows https://indieauth.spec.indieweb.org/#client-identifier
|
||||||
|
|
|
@ -9,7 +9,7 @@ import * as assert from 'assert';
|
||||||
import { AuthorizationCode, type AuthorizationTokenConfig } from 'simple-oauth2';
|
import { AuthorizationCode, type AuthorizationTokenConfig } from 'simple-oauth2';
|
||||||
import pkceChallenge from 'pkce-challenge';
|
import pkceChallenge from 'pkce-challenge';
|
||||||
import { JSDOM } from 'jsdom';
|
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 Fastify, { type FastifyReply, type FastifyInstance } from 'fastify';
|
||||||
import { port, relativeFetch, signup, startServer } from '../utils.js';
|
import { port, relativeFetch, signup, startServer } from '../utils.js';
|
||||||
import type { INestApplicationContext } from '@nestjs/common';
|
import type { INestApplicationContext } from '@nestjs/common';
|
||||||
|
@ -224,7 +224,7 @@ describe('OAuth', () => {
|
||||||
});
|
});
|
||||||
assert.strictEqual(createResponse.status, 200);
|
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');
|
assert.strictEqual(createResponseBody.createdNote.text, 'test');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -303,10 +303,10 @@ describe('OAuth', () => {
|
||||||
});
|
});
|
||||||
assert.strictEqual(createResponseAlice.status, 200);
|
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');
|
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');
|
assert.strictEqual(createResponseBodyBob.createdNote.user.username, 'bob');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue