Merge pull request 'Update remaining Misskey references' (#171) from update-reamining-misskey-references into main

Reviewed-on: FoundKeyGang/FoundKey#171
This commit is contained in:
Norm 2022-09-28 02:39:07 +00:00
commit c68615e7a5
6 changed files with 45 additions and 45 deletions

View file

@ -16,7 +16,7 @@
</main> </main>
<div v-if="!root" class="powered-by"> <div v-if="!root" class="powered-by">
<b><MkA to="/">{{ host }}</MkA></b> <b><MkA to="/">{{ host }}</MkA></b>
<small>Powered by <a href="https://github.com/misskey-dev/misskey" target="_blank">Misskey</a></small> <small>Powered by <a href="https://akkoma.dev/FoundKeyGang/FoundKey" target="_blank">FoundKey</a></small>
</div> </div>
</div> </div>
</div> </div>

View file

@ -29,7 +29,7 @@
</div> </div>
<div v-if="poweredBy" class="powered-by"> <div v-if="poweredBy" class="powered-by">
<b><MkA to="/">{{ host }}</MkA></b> <b><MkA to="/">{{ host }}</MkA></b>
<small>Powered by <a href="https://github.com/misskey-dev/misskey" target="_blank">Misskey</a></small> <small>Powered by <a href="https://akkoma.dev/FoundKeyGang/FoundKey" target="_blank">FoundKey</a></small>
</div> </div>
</template> </template>
</div> </div>

View file

@ -1,45 +1,45 @@
import { expectType } from 'tsd'; import { expectType } from 'tsd';
import * as Misskey from '../src'; import * as foundkey from '../src';
describe('API', () => { describe('API', () => {
test('success', async () => { test('success', async () => {
const cli = new Misskey.api.APIClient({ const cli = new foundkey.api.APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN' credential: 'TOKEN'
}); });
const res = await cli.request('meta', { detail: true }); const res = await cli.request('meta', { detail: true });
expectType<Misskey.entities.DetailedInstanceMetadata>(res); expectType<foundkey.entities.DetailedInstanceMetadata>(res);
}); });
test('conditional respose type (meta)', async () => { test('conditional respose type (meta)', async () => {
const cli = new Misskey.api.APIClient({ const cli = new foundkey.api.APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN' credential: 'TOKEN'
}); });
const res = await cli.request('meta', { detail: true }); const res = await cli.request('meta', { detail: true });
expectType<Misskey.entities.DetailedInstanceMetadata>(res); expectType<foundkey.entities.DetailedInstanceMetadata>(res);
const res2 = await cli.request('meta', { detail: false }); const res2 = await cli.request('meta', { detail: false });
expectType<Misskey.entities.LiteInstanceMetadata>(res2); expectType<foundkey.entities.LiteInstanceMetadata>(res2);
const res3 = await cli.request('meta', { }); const res3 = await cli.request('meta', { });
expectType<Misskey.entities.LiteInstanceMetadata>(res3); expectType<foundkey.entities.LiteInstanceMetadata>(res3);
const res4 = await cli.request('meta', { detail: true as boolean }); const res4 = await cli.request('meta', { detail: true as boolean });
expectType<Misskey.entities.LiteInstanceMetadata | Misskey.entities.DetailedInstanceMetadata>(res4); expectType<foundkey.entities.LiteInstanceMetadata | foundkey.entities.DetailedInstanceMetadata>(res4);
}); });
test('conditional respose type (users/show)', async () => { test('conditional respose type (users/show)', async () => {
const cli = new Misskey.api.APIClient({ const cli = new foundkey.api.APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN' credential: 'TOKEN'
}); });
const res = await cli.request('users/show', { userId: 'xxxxxxxx' }); const res = await cli.request('users/show', { userId: 'xxxxxxxx' });
expectType<Misskey.entities.UserDetailed>(res); expectType<foundkey.entities.UserDetailed>(res);
const res2 = await cli.request('users/show', { userIds: ['xxxxxxxx'] }); const res2 = await cli.request('users/show', { userIds: ['xxxxxxxx'] });
expectType<Misskey.entities.UserDetailed[]>(res2); expectType<foundkey.entities.UserDetailed[]>(res2);
}); });
}); });

View file

@ -1,17 +1,17 @@
import { expectType } from 'tsd'; import { expectType } from 'tsd';
import * as Misskey from '../src'; import * as foundkey from '../src';
describe('Streaming', () => { describe('Streaming', () => {
test('emit type', async () => { test('emit type', async () => {
const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' });
const mainChannel = stream.useChannel('main'); const mainChannel = stream.useChannel('main');
mainChannel.on('notification', notification => { mainChannel.on('notification', notification => {
expectType<Misskey.entities.Notification>(notification); expectType<foundkey.entities.Notification>(notification);
}); });
}); });
test('params type', async () => { test('params type', async () => {
const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' });
// TODO: 「stream.useChannel の第二引数として受け入れる型が // TODO: 「stream.useChannel の第二引数として受け入れる型が
// { // {
// otherparty?: User['id'] | null; // otherparty?: User['id'] | null;
@ -20,7 +20,7 @@ describe('Streaming', () => {
// になっている」というテストを行いたいけどtsdでの書き方がわからない // になっている」というテストを行いたいけどtsdでの書き方がわからない
const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' }); const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' });
messagingChannel.on('message', message => { messagingChannel.on('message', message => {
expectType<Misskey.entities.MessagingMessage>(message); expectType<foundkey.entities.MessagingMessage>(message);
}); });
}); });
}); });

View file

@ -20,7 +20,7 @@ describe('API', () => {
fetchMock.resetMocks(); fetchMock.resetMocks();
fetchMock.mockResponse(async (req) => { fetchMock.mockResponse(async (req) => {
const body = await req.json(); const body = await req.json();
if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') { if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') {
if (body.i === 'TOKEN') { if (body.i === 'TOKEN') {
return JSON.stringify({ id: 'foo' }); return JSON.stringify({ id: 'foo' });
} else { } else {
@ -32,7 +32,7 @@ describe('API', () => {
}); });
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -43,7 +43,7 @@ describe('API', () => {
}); });
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
url: 'https://misskey.test/api/i', url: 'https://foundkey.test/api/i',
method: 'POST', method: 'POST',
body: { i: 'TOKEN' } body: { i: 'TOKEN' }
}); });
@ -53,7 +53,7 @@ describe('API', () => {
fetchMock.resetMocks(); fetchMock.resetMocks();
fetchMock.mockResponse(async (req) => { fetchMock.mockResponse(async (req) => {
const body = await req.json(); const body = await req.json();
if (req.method == 'POST' && req.url == 'https://misskey.test/api/notes/show') { if (req.method == 'POST' && req.url == 'https://foundkey.test/api/notes/show') {
if (body.i === 'TOKEN' && body.noteId === 'aaaaa') { if (body.i === 'TOKEN' && body.noteId === 'aaaaa') {
return JSON.stringify({ id: 'foo' }); return JSON.stringify({ id: 'foo' });
} else { } else {
@ -65,7 +65,7 @@ describe('API', () => {
}); });
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -76,7 +76,7 @@ describe('API', () => {
}); });
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
url: 'https://misskey.test/api/notes/show', url: 'https://foundkey.test/api/notes/show',
method: 'POST', method: 'POST',
body: { i: 'TOKEN', noteId: 'aaaaa' } body: { i: 'TOKEN', noteId: 'aaaaa' }
}); });
@ -85,7 +85,7 @@ describe('API', () => {
test('204 No Content で null が返る', async () => { test('204 No Content で null が返る', async () => {
fetchMock.resetMocks(); fetchMock.resetMocks();
fetchMock.mockResponse(async (req) => { fetchMock.mockResponse(async (req) => {
if (req.method == 'POST' && req.url == 'https://misskey.test/api/reset-password') { if (req.method == 'POST' && req.url == 'https://foundkey.test/api/reset-password') {
return { status: 204 }; return { status: 204 };
} else { } else {
return { status: 404 }; return { status: 404 };
@ -93,7 +93,7 @@ describe('API', () => {
}); });
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -102,7 +102,7 @@ describe('API', () => {
expect(res).toEqual(null); expect(res).toEqual(null);
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
url: 'https://misskey.test/api/reset-password', url: 'https://foundkey.test/api/reset-password',
method: 'POST', method: 'POST',
body: { i: 'TOKEN', token: 'aaa', password: 'aaa' } body: { i: 'TOKEN', token: 'aaa', password: 'aaa' }
}); });
@ -112,7 +112,7 @@ describe('API', () => {
fetchMock.resetMocks(); fetchMock.resetMocks();
fetchMock.mockResponse(async (req) => { fetchMock.mockResponse(async (req) => {
const body = await req.json(); const body = await req.json();
if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') { if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') {
if (typeof body.i === 'string') { if (typeof body.i === 'string') {
return JSON.stringify({ id: 'foo' }); return JSON.stringify({ id: 'foo' });
} else { } else {
@ -134,7 +134,7 @@ describe('API', () => {
try { try {
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -162,7 +162,7 @@ describe('API', () => {
try { try {
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -179,7 +179,7 @@ describe('API', () => {
try { try {
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });
@ -200,7 +200,7 @@ describe('API', () => {
try { try {
const cli = new APIClient({ const cli = new APIClient({
origin: 'https://misskey.test', origin: 'https://foundkey.test',
credential: 'TOKEN', credential: 'TOKEN',
}); });

View file

@ -3,8 +3,8 @@ import Stream from '../src/streaming';
describe('Streaming', () => { describe('Streaming', () => {
test('useChannel', async () => { test('useChannel', async () => {
const server = new WS('wss://misskey.test/streaming'); const server = new WS('wss://foundkey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new Stream('https://foundkey.test', { token: 'TOKEN' });
const mainChannelReceived: any[] = []; const mainChannelReceived: any[] = [];
const main = stream.useChannel('main'); const main = stream.useChannel('main');
main.on('meUpdated', payload => { main.on('meUpdated', payload => {
@ -40,8 +40,8 @@ describe('Streaming', () => {
}); });
test('useChannel with parameters', async () => { test('useChannel with parameters', async () => {
const server = new WS('wss://misskey.test/streaming'); const server = new WS('wss://foundkey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new Stream('https://foundkey.test', { token: 'TOKEN' });
const messagingChannelReceived: any[] = []; const messagingChannelReceived: any[] = [];
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
messaging.on('message', payload => { messaging.on('message', payload => {
@ -78,8 +78,8 @@ describe('Streaming', () => {
}); });
test('ちゃんとチャンネルごとにidが異なる', async () => { test('ちゃんとチャンネルごとにidが異なる', async () => {
const server = new WS('wss://misskey.test/streaming'); const server = new WS('wss://foundkey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new Stream('https://foundkey.test', { token: 'TOKEN' });
stream.useChannel('messaging', { otherparty: 'aaa' }); stream.useChannel('messaging', { otherparty: 'aaa' });
stream.useChannel('messaging', { otherparty: 'bbb' }); stream.useChannel('messaging', { otherparty: 'bbb' });
@ -101,8 +101,8 @@ describe('Streaming', () => {
}); });
test('Connection#send', async () => { test('Connection#send', async () => {
const server = new WS('wss://misskey.test/streaming'); const server = new WS('wss://foundkey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new Stream('https://foundkey.test', { token: 'TOKEN' });
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
messaging.send('read', { id: 'aaa' }); messaging.send('read', { id: 'aaa' });
@ -124,8 +124,8 @@ describe('Streaming', () => {
}); });
test('Connection#dispose', async () => { test('Connection#dispose', async () => {
const server = new WS('wss://misskey.test/streaming'); const server = new WS('wss://foundkey.test/streaming');
const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); const stream = new Stream('https://foundkey.test', { token: 'TOKEN' });
const mainChannelReceived: any[] = []; const mainChannelReceived: any[] = [];
const main = stream.useChannel('main'); const main = stream.useChannel('main');
main.on('meUpdated', payload => { main.on('meUpdated', payload => {